could be a stupid question:- I have a requirement that part of the same transaction, I need to insert and subsequently make two more updates to the same records (same pk) in a single transaction. These operations have to be all or nothing. Anyway to achieve in a single transaction? or any other idea?
I believe this is database related, so I'll move this to our JDBC forum.
For transactions in JDBC you can use a combination of Connection.setAutoCommit(false) to disable automatic committing of separate statements, Connection.commit() to finish a transaction and Connection.rollback() to undo everything after the last commit.
I don't get one thing though. Why can't you set these values for the newly inserted record when you insert it?