openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Don Brady <dbr...@pobox.com>
Subject Re: Should UserTransaction Work?
Date Mon, 08 Jan 2007 04:34:58 GMT
Michael Dick wrote:
>
> If you lookup the UserTransaction in your Session Bean, then your 
> approach
> should work. I tried making the Feature Pack sample application a BMT 
> bean
> and it seemed to work for me.  I can send you the application if you'd 
> like.
>
> If the transaction is started prior to looking up a  BMT bean, then it 
> will
> be suspended before the bean method
> executes. I don't know much about web services, this might not be the 
> case
> or possible.

Michael and Craig and Kevin,

 I got it to work!  Thanks very much for the help.

 My error was in failing to start the Transaction *prior to* creating 
the EntityManager.   Once I did that, it worked.

 I should have realized that  OpenJPA needed to have the Global 
Transaction already started by the time it looks to see if it is running 
in a Transaction context.

 As Craig mentioned,  this BMT approach is a very nice pattern to have 
working, because it allows me to pass the underlying error back to the 
Web Service caller, rather than just the non-specfic 
TransactionRolledBackException from a CMT bean. 

 Thanks,

 Don



Mime
View raw message