Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reg. container transactions

 
sujatha laki
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post your code and deployment descriptors.

What DB are you accessing?
 
sujatha laki
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic