aspose file tools*
The moose likes JDBC and the fly likes JDBC Transactions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC Transactions" Watch "JDBC Transactions" New topic
Author

JDBC Transactions

Horacio Zapata
Greenhorn

Joined: Mar 10, 2009
Posts: 1
Hi, can someone help me.

1. I create a connection from Java Application to an Oracle Database by JDBC.
2. I set autoComit to false. (begin a transaction)
3. I update a TABLE1
4. I create a prepareStatement with the connection object created in step 1.
5. I call a stored procedure in the database that uses TABLE1,
6. BUT THE PROBLEM IS the procedure don't see the changes done in the step 3.

Why is happening this if I suppose that is the same connection.

I cant do a commit, because I need to do an only transaction for commit it or roll back

How can resolve o fix this?
What am I trying to do is possible?
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


3. I update a TABLE1
4. I create a prepareStatement with the connection object created in step 1.
5. I call a stored procedure in the database that uses TABLE1,


Do you mean Table1 update is to be seen in SP , then there are 2 transaction.. its not atomic , hence you got to segregate the transaction.

check Savepoint also..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JDBC Transactions