File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to commit the hibernate based transaction through a statless session bean's transaction

 
Barnabas Jeremiah
Greenhorn
Posts: 26
Chrome Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,
I am new to Hibernate..... I am using Hibernate Queries inside my Stateless Session Bean's Business logic...
But the Session Bean's Transaction commit or rollback will not be visible to the hibernate's Transaction other than it's own transaction.. how to make these two transactions visible to each other... so that using my Session bean's Transaction's commit if no errors would save the hibernate's Transaction.....
.... if I would have asked any wrong cos my less knowledge pardon me and kindly reply me...
thanks in Advance
Barnabas Jerry...
 
lokesh sree
Ranch Hand
Posts: 100
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could be because your transaction isolation is set to read committed. which means changes made in one transaction(tx1) will be visible to another transaction(tx2) only if tx2 reads the data after tx1 has committed the changes.
If you want the changes in both the txs to be visible to both, you will need to use tx isolation of "read uncommitted".
You can start by reading the details here http://en.wikipedia.org/wiki/Isolation_(database_systems)
Hope that helps.
 
Barnabas Jeremiah
Greenhorn
Posts: 26
Chrome Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks lokesh..... but who i can merge these ejb session as well as the hibernate session in one...? i want my ejb session should be applicable to the hibernate's session.. so when the program executes with out error the ejb session will commit the transaction...
 
lokesh sree
Ranch Hand
Posts: 100
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohh.. ok. I have misunderstood your question. I thought you were speaking about parallel transactions and hence provided info about tx isolation.
I do not have much idea about hibernate specific txs.
Normally in case of JEE(EJBs using JPA), with Container Managed Transaction management(CMT), the txs of the EJBs will take care of the tx success/failure of the JPA/db calls as well.
i.e, the tx of the ejb session will commit only if the db call made using jpa succeeds.
But i am not sure what you meant by hibernate tx. You can provide some additional details and see if some one else can help you.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic