You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Ivan Vitoria (JIRA)" <ji...@apache.org> on 2011/03/24 17:46:05 UTC

[jira] [Created] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Transactional JAX-RS Service (Spring 3 + Hibernate 3)
-----------------------------------------------------

                 Key: CXF-3418
                 URL: https://issues.apache.org/jira/browse/CXF-3418
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.3.2
            Reporter: Ivan Vitoria
            Priority: Critical


Hello,

I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...

A sample NetBeans project is attached. 

Thanks in advance

Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011135#comment-13011135 ] 

Ivan Vitoria commented on CXF-3418:
-----------------------------------

Hi Sergey,

I apologize for attaching a NB project. Now, you can find a war file with its source code. I'm not familiarized with Maven yet but definitely i'm going to learn how it works as soon as possible.

Thanks,

Ivan

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Reopened] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Vitoria reopened CXF-3418:
-------------------------------


Hi Sergey,

I've noticed that if other class extends from GenericRestServiceImpl the MessageContext is not injected! However both ServletContext and UriInfo are correctly injected. 

Let me know if you need extra information.

Regards,

Ivan

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010770#comment-13010770 ] 

Sergey Beryozkin commented on CXF-3418:
---------------------------------------

Hi Ivan

Can you please remove those attachments and just attach a WAR, with the source of your sample code ? The same way as you did it before. I'm not using NetBeans. Ideally it is either a Maven project or self-contained WAR with the source which we need to reproduce the issue quickly

thanks, Sergey


> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional v1.0.part1.rar, JaxrsTransactional v1.0.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Vitoria updated CXF-3418:
------------------------------

    Attachment: JaxrsTransactional.part1.rar

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Vitoria updated CXF-3418:
------------------------------

    Attachment:     (was: JaxrsTransactional v1.0.part2.rar)

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Vitoria updated CXF-3418:
------------------------------

    Attachment:     (was: JaxrsTransactional v1.0.part1.rar)

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012005#comment-13012005 ] 

Sergey Beryozkin commented on CXF-3418:
---------------------------------------

Hi - so can this issue be resolved again :-) ?

Also if you have IExtraBehaviour extending IRestService then it should also work  


> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012011#comment-13012011 ] 

Ivan Vitoria commented on CXF-3418:
-----------------------------------

Hi, 

Yes this issue is completely resolved :D. 

It would be interesting if there was inheritance in the definition of the models, such as the "parent" atribute of Spring... 

Thank you for your time Sergey!

Regards,

Ivan 



> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-3418.
-----------------------------------

    Resolution: Not A Problem

Moving Context setters to the dedicated interface fixes the problem

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011951#comment-13011951 ] 

Ivan Vitoria commented on CXF-3418:
-----------------------------------

Hi Sergey,

It works, it's amazing!

I've needed to add the other context elements because an exception was thrown. The new interface looks like this:

public interface IContext {

    @Context
    void setUriInfo(UriInfo uriInfo);

    @Context
    void setMessageContext(MessageContext mc);

    @Context
    void setServletContext(ServletContext sc);
}

Many thanks, again.

Best regards,

Ivan

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011336#comment-13011336 ] 

Sergey Beryozkin commented on CXF-3418:
---------------------------------------

Hi Ivan

Debugging this project is not easy :-). Can you please give me a favor and try the following:

you have 

public class GenericRestServiceImpl {

@Context
public void setUriInfo(UriInfo uriInfo) {}

}

Can you please do the following:

1. Add interface say IContext:

public interface IContext {
@Context
void setUriInfo(UriInfo uriInfo);
} 
}

and then

public class GenericRestServiceImpl implements IRestService, IContext{


public void setUriInfo(UriInfo uriInfo) {}

}

Can you try it please ? 

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-3418.
-----------------------------------

    Resolution: Not A Problem

thanks

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011268#comment-13011268 ] 

Sergey Beryozkin commented on CXF-3418:
---------------------------------------

Hi Ivan - no probs at all - thanks for attaching the war

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Vitoria updated CXF-3418:
------------------------------

    Attachment: JaxrsTransactional v1.0.part1.rar

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional v1.0.part1.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Vitoria updated CXF-3418:
------------------------------

    Attachment: JaxrsTransactional v1.0.part2.rar

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional v1.0.part1.rar, JaxrsTransactional v1.0.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011994#comment-13011994 ] 

Sergey Beryozkin commented on CXF-3418:
---------------------------------------

So, you have the following case.

{code}
public interface IContext { 
    @Context void setUriInfo(UriInfo uriInfo); 
    @Context void setMessageContext(MessageContext mc); 
    @Context void setServletContext(ServletContext sc); }
{code}

{code}
public class GenericRestServiceImpl implements IRestService, IContext {
}

public class GenericRestServiceImpl2 extends GenericRestServiceImpl {
} 
{code}

and only MessageContext is not injected ?

Can you double check please ? Have you updated the model to reference the IRestService interface only ?

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012003#comment-13012003 ] 

Ivan Vitoria commented on CXF-3418:
-----------------------------------

Sorry, the three context elements were not been injected instead of just MessageContext. My fault!

The problem was that the inherited class needed an explicit interface due to the new methods, and this interface must be added to the new model.

{code:xml} 
 public class GenericRestServiceImpl2 extends GenericRestServiceImpl implements IExtraBehaviour {
 
	public void extraMethod() {...}
 
}

@Transactional
public interface IExtraBehaviour {
	
	void extraMethod();

}

<model xmlns="http://cxf.apache.org/jaxrs">
    <resource name="IExtraBehaviour" path="/" consumesType="application/xml" producesType="application/xml">
        <!-- IRestService methods -->
		 <operation name="get" verb="GET" path="/{id}">
            <param name="id" type="PATH"/>
        </operation>
        <!-- IExtraBehaviour methods -->
        <operation name="extraMethod" verb="GET" path="/extra" />        
    </resource>
</model>

{code} 

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3418) Transactional JAX-RS Service (Spring 3 + Hibernate 3)

Posted by "Ivan Vitoria (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Vitoria updated CXF-3418:
------------------------------

    Attachment: JaxrsTransactional.part2.rar

> Transactional JAX-RS Service (Spring 3 + Hibernate 3)
> -----------------------------------------------------
>
>                 Key: CXF-3418
>                 URL: https://issues.apache.org/jira/browse/CXF-3418
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.3.2
>            Reporter: Ivan Vitoria
>            Priority: Critical
>         Attachments: JaxrsTransactional.part1.rar, JaxrsTransactional.part2.rar
>
>
> Hello,
> I have some JAX-RS servers configured through Spring. Also, i'm using Hibernate DAOs and the OpenSessionInViewFilter of Spring-ORM. I have no problem when I add the @Transactional annotation to the DAO layer, but i would like to have the REST methods in the same transaction, so i've annoated the services. But I can't do it, neither annotating the interface nor the classes.  A ServiceConstructionException is throwed as soon as I add the @Transactional to the service...
> A sample NetBeans project is attached. 
> Thanks in advance
> Ivan

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira