wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes reg. container transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "reg. container transactions" Watch "reg. container transactions" New topic
Author

reg. container transactions

sujatha laki
Greenhorn

Joined: Mar 19, 2008
Posts: 2
Hi all,

I need a favor from you all. The container is not committing the transaction. Even i tried with User Transaction but the record is not getting persisted in the database. Can anyone suggest me how to commit the container transaction, if any possible way exists?

Regards
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Please post your code and deployment descriptors.

What DB are you accessing?


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
sujatha laki
Greenhorn

Joined: Mar 19, 2008
Posts: 2
hi,

I am using TopLink to persist the data and sending the descriptor for the method for which its not committing.

<session>
<description>Session Bean ( Stateless )</description>
<display-name>WorkOrderEJB</display-name>
<ejb-name>WorkOrderEJB</ejb-name>
<home>WorkOrderHome</home>
<remote>WorkOrderRemote</remote>
<local-home>WorkOrderLocalHome</local-home>
<local>WorkOrderLocalRemote</local>
<ejb-class>WorkOrderEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>

<container-transaction>
<method>
<ejb-name>WorkOrderEJB</ejb-name>
<method-intf>Remote</method-intf>
<method-name>createPendingDetails</method-name>
<method-params>
<method-param>long</method-param>
<method-param>java.util.ArrayList</method-param>
</method-params>
<trans-attribute>Required </trans-attribute>
</container-transaction>

Query is getting fired and the count(for insertion) is coming but not getting committed. can you guide me how to proceed further.

thanks
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
Some more questions ...

1. Please post your code, including that which obtains the DataSource and JDBC connection, and which closes the connection.

2. Which EJB server are you using? There may be a server-specific setting needed. For instance, WebLogic Server requires the use of a Tx Data Source for EJB-managed transactions.

3. Does your log show any errors?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reg. container transactions
 
Similar Threads
Using entity beans in project
Services EJB or Container ?
In CMT when does a transaction actually commit
setRollbackOnly() is ejbCreate()
transaction management in spring