Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Transactions

 
Horacio Zapata
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic