IntelliJ Java IDE
The moose likes Object Relational Mapping and the fly likes Problem In EJB Transaction Management Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Problem In EJB Transaction Management" Watch "Problem In EJB Transaction Management" New topic
Author

Problem In EJB Transaction Management

Gaurav Wankhade
Greenhorn

Joined: Jul 28, 2007
Posts: 4
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

Joined: Feb 05, 2001
Posts: 16624

"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.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 504

Set the transaction isolation level as [TRANSACTION_READ_UNCOMMITTED]. It is used to read uncommited values ina transaction.


If you are not laughing at yourself, then you just didn't get the joke.
Gaurav Wankhade
Greenhorn

Joined: Jul 28, 2007
Posts: 4
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

Joined: May 16, 2005
Posts: 504

Is it working fine without the isolation level setting?
Gaurav Wankhade
Greenhorn

Joined: Jul 28, 2007
Posts: 4
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

Joined: May 22, 2003
Posts: 32
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


Tony McClay<br />Architect / Developer, SOA and Jave Enterprise Edition 1-5<br />---------------------------------------------------------------------- <br />Sun Certified Enterprise Architect, Enterprise Edition 5 (Step 1 of 3)<br />Sun Certified Web Component Developer, Enterprise Edition 4<br />Sun Certified Business Component Developer Enterprise Edition 5<br />Sun Certified Programmer , Standard Edition 5.0
Gaurav Wankhade
Greenhorn

Joined: Jul 28, 2007
Posts: 4
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.
 
 
subject: Problem In EJB Transaction Management
 
Threads others viewed
WebLogic Not reading an updated value in the same transaction
EJB transactions
Transactions not rolling back
Doubt...
What is the name of hibernate 2 exception?
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture