This content has been marked as final.
Show 2 replies
-
1. Re: tx attributte - supports doesn't work as expected
jaikiran Jun 3, 2007 1:43 PM (in response to adamzrk)EntityManager must be access within a transaction
Which means that when you are accessing the entity manager in your createAirport method, there should be an active transaction. As you already correctly mentioned:
As you can see I configured it with SUPPORTS transaction attribute, so when there is a transaction all methods in my bean will use it, when there is no transaction context then bean wouldn't begin a new one
I believe when the createAirport method is being called, there is no active transaction and since the transaction attribute that you have specified is SUPPORTS, the server wont create a new one. You might want to change the transaction attribute to REQUIRED instead of SUPPORTS. For transaction attribute REQUIRED, a new transaction is created when there is no active transaction. If there is a active transaction then the same will be used for that method. So try changing@TransactionAttribute(TransactionAttributeType.SUPPORTS)
to@TransactionAttribute(TransactionAttributeType.REQUIRED)
-
2. Re: tx attributte - supports doesn't work as expected
adamzrk Jun 3, 2007 3:07 PM (in response to adamzrk)I know what all transaction attributes mean and I do not want the REQUIRED attribute. According to specification jboss have implemented tx support not very well.....
Regards
Adam