Transaction Management in CMP through Reflection
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hemant_Satam
Posted On:   Thursday, May 16, 2002 09:40 AM

I am calling a session bean using reflection. The session bean has transaction attribute for this method set to REQUIRES . The entity beans called from the session bean method (JNDI Lookup) uses transaction property REQUIRES . If any database error occurs, updates are rolledback but inserts are committed. Does anybody have a solution?? I searched the site for solutions and found that the only difference between the suggested apporach and the one I have used is the call of session bean method in my case is carried out through reflection. Need Urgent Help!!!.    More>>

I am calling a session bean using reflection.


The session bean has transaction attribute for this method set to REQUIRES . The entity beans called from the session bean method (JNDI Lookup) uses transaction property REQUIRES .

If any database error occurs, updates are rolledback but inserts are committed. Does anybody have a solution??




I searched the site for solutions and found that the only difference between the suggested apporach and the one I have used is the call of session bean method in my case is carried out through reflection.
Need Urgent Help!!!.

   <<Less

Re: Transaction Management in CMP through Reflection

Posted By:   Hemant_Satam  
Posted On:   Friday, May 17, 2002 06:31 AM

The problem has been solved using TXDataSource.


There is no problem in using reflection with CMP for transaction management.


I was using Datasource instead of TXDatasource causing the entity beans to work in auto-commit mode.


Following is found on bea site


(http://edocs.bea.com/wls/docs70/ejb/EJB_design.html)





Always Use A Transactional Datasource for Container-Managed EJBs


If you configure a JDBC datasource factory for use with container-managed EJBs, make sure you configure a transactional datasource (TXDataSource) rather than a non-transactional datasource (DataSource). With a non-transactional datasource, the JDBC connection operates in auto commit mode, committing each insert and update operation to the database immediately, rather than as part of a container-managed transaction.
About | Sitemap | Contact