-
1. Re: Seam transaction manager : use of ejb-transaction?
fcousin Nov 14, 2008 5:02 PM (in response to fcousin)If I am working in an EJB environment, do I always have to install the synchronization component? If not, when do I have to do it? Why? Does the default configuration not work?
I also read the corresponding chapter in
Seam in Action
, but I still fail to understand this.What did I miss?
Thans for your help.
Florence.
-
2. Re: Seam transaction manager : use of ejb-transaction?
fcousin Nov 14, 2008 5:12 PM (in response to fcousin)Sorry, the link to the documentation is bad : it's here .
-
3. Re: Seam transaction manager : use of ejb-transaction?
steffi.stephanie.stroka.salzburgresearch.at Nov 14, 2008 8:49 PM (in response to fcousin)You do not need to implement a synchronization component (actually when you have seam managed transactions). As I understood, you have the possibility to give further instructions for transaction handling with a synchronization implementation, when
<transaction:ejb-transaction>
is installed, but commit and rollback actions to the database are still managed by Seam.
In the case of our application, we have ejb-transactions enabled and we use it to apply revision management. We get a javax.transaction.UserTransaction by doing a jndi lookup on
java:comp/UserTransaction
, we store transaction data like updates in another bean which we map to the current transaction and we register a synchronization((UserTransaction) Component.getInstance("org.jboss.seam.transaction.transaction", ScopeType.EVENT) ).registerSynchronization(sync)
which implements beforeCompletion and afterCompletion methods.