Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem In EJB Transaction Management

 
Gaurav Wankhade
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I m using Transaction management in EJB.
i set the attribute as Required and Container Managed transaction.
Internaly 2 methods are call in EJB

First one insert row in database and second method read some data from
row inserted . But Data is not commited in database till the transaction not get completed . in second method i m getting error As The data not present in database .

please help me in this how to read the data also managing the transaction.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Gaurav GauravW",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with display names get deleted.
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set the transaction isolation level as [TRANSACTION_READ_UNCOMMITTED]. It is used to read uncommited values ina transaction.
 
Gaurav Wankhade
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arun Kumarr:
Set the transaction isolation level as [TRANSACTION_READ_UNCOMMITTED]. It is used to read uncommited values ina transaction.



Hi Arun Thanks For your Reply

I set the isolation level in weblogic-ejb-jar.xml as follows

<transaction-isolation>
<isolation-level>TRANSACTION_READ_UNCOMMITTED</isolation-level>
<method>
<ejb-name>InvoiceManagementTest</ejb-name>
<method-name>*</method-name>
</method>
</transaction-isolation>



and i deployed that ejb on server but its giving error


*********7
<Jul 31, 2007 8:10:51 PM IST> <Warning> <RMI> <BEA-080009> <Error thrown by RMI
server: weblogic.jdbc.common.internal.RmiDataSource@ef9d00 invoking: getConnecti
on()>
<Jul 31, 2007 8:10:51 PM IST> <Warning> <RMI> <BEA-080009> <Error thrown by RMI
server: weblogic.jdbc.common.internal.RmiDataSource@ef9d00 invoking: getConnecti
on()>
<Jul 31, 2007 8:10:51 PM IST> <Warning> <RMI> <BEA-080009> <Error thrown by RMI
server: weblogic.jdbc.common.internal.RmiDataSource@ef9d00 invoking: getConnecti
on()>
<Jul 31, 2007 8:10:51 PM IST> <Warning> <RMI> <BEA-080009> <Error thrown by RMI
server: weblogic.jdbc.common.internal.RmiDataSource@ef9d00 invoking: getConnecti
on()>
<Jul 31, 2007 8:10:51 PM IST> <Warning> <RMI> <BEA-080009> <Error thrown by RMI
server: weblogic.jdbc.common.internal.RmiDataSource@1f6ae4d invoking: getConnect
ion()>
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it working fine without the isolation level setting?
 
Gaurav Wankhade
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arun Kumarr:
Is it working fine without the isolation level setting?


Ya its working fine but not able to read the database values inserted in same transaction.
 
Tony McClay
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry, I can not easily tell from the post. What version of Weblogic are you using? (Implied EJB version as well) Are you using KODO/OpenJPA or Hibernate?

This will help me answer your question.


Tony
Sun Certified Web Business Component Developer
Sun Certified Web Components Developer
Sun Certified Programmer for the Java 2 Platform
 
Gaurav Wankhade
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony McClay:
I am sorry, I can not easily tell from the post. What version of Weblogic are you using? (Implied EJB version as well) Are you using KODO/OpenJPA or Hibernate?

This will help me answer your question.


Tony
Sun Certified Web Business Component Developer
Sun Certified Web Components Developer
Sun Certified Programmer for the Java 2 Platform




Hi Tony ,
I m using weblogic 8 with service pack 2
And EJB version is 2.0
I m not using Hibernate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic