[jboss-user] [EJB 3.0] - Re: $Proxy200 error & Invalid (i.e. remote) invocation of lo

Wolfgang Knauf do-not-reply at jboss.com
Thu Jan 8 07:54:23 EST 2009


Hi,

to comment on one of your older questions:

anonymous wrote : You are right...it is all managed by the container especially when using entity managers but surely you have to be calling em.gettransaction.begin(), em.gettransaction.commit(),em.persist(object) from somewhere in code to make it happen !

By default a transaction is started automatically when you call a session bean method from the client, and it is committed afterwards. So you don't need to care about them. 
More control over transaction (e.g. you want to start new one if one session bean calls another bean's method) can be achieved through annotations like @RequiresNew.

And only if all this is not sufficient, you can perform your own transaction handling. But in most use cases, the default behavior is good enough I think.

Hope this helps

Wolfgang

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200328#4200328

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200328



More information about the jboss-user mailing list