dcsimg
Applying transactions over session/entity EJB in websphere
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mohamed_Mokhtar
Posted On:   Friday, March 14, 2003 05:23 AM

I'm applying the session facade design pattern in when a session EJb calls multiple entity beans and DAOs. Both entity and session EJBs are Container managed in their transactions with the transaction type required and isolation level serializable. The problem is that when the session bean finish its call and while returning back i found it throws an exception "Illegal use of 1pc resource" then i found it throws a transaction rolled back exception. I debuged and i found it throwing this exception in a method called fom the stubs and this method is ejbcontainer.postInvoke(). when this method is called the exception is thrown. The code was working in websphere 3.5.3 corectly but when i migrated    More>>

I'm applying the session facade design pattern in when a session EJb calls multiple entity beans and DAOs.
Both entity and session EJBs are Container managed in their transactions with the transaction type required and isolation level serializable.

The problem is that when the session bean finish its call and while returning back i found it throws an exception "Illegal use of 1pc resource" then i found it throws a transaction rolled back exception.

I debuged and i found it throwing this exception in a method called fom the stubs and this method is
ejbcontainer.postInvoke().
when this method is called the exception is thrown.

The code was working in websphere 3.5.3 corectly but when i migrated to websphere 4.0.3 this exception is thrown.

I dont know is it cause of the JDBC driver or what. i'm sure that the JDBC drive is configured correctly. I need any bodys help please

   <<Less

Re: Applying transactions over session/entity EJB in websphere

Posted By:   Harsh_Soni  
Posted On:   Saturday, May 31, 2003 12:49 PM

One of the causes you're getting this 1PC error is because you are using JDBC from within session bean, in addition to using Entity Beans(this is presuming you have a Non-XA datasource). This is because the session bean erraneously obtains a different datasource instance than the CMP bean. This is a bug and a patch for it can be obtained from IBM (please visit http://www-1.ibm.com/support/docview.wss?rs=0&org=SW&doc=4000986). Putting this patch will obviate the need of using an XA datasource.

Re: Applying transactions over session/entity EJB in websphere

Posted By:   Nick_Maiorano  
Posted On:   Saturday, March 15, 2003 07:38 AM

Mohamed,



Based on the error message "Illegal use of 1pc resource", it looks as if the jdbc driver you are using is not XA compliant or has not been XA enabled in the configuration. Either enable the XA on the JDBC driver or use another driver that support XA. You'll have to consult the websphere and/or jdbc driver manuals for this.

About | Sitemap | Contact