Are you rolling the transaction back? If not, I believe that the connection object may be performing a commit when it closes if it detects an open transaction. Perhaps someone more in the know on this issue could comment?
I very much doubt that you'd be seeing the behaviour that Bear suggests. The natural thing to do (if anything - I would suggest nothing) would be for the driver software to rollback under those circumstances.
The more likely explanation is that the database you're using (my guess would be the ubiquitous MySQL) doesn't support transactions by default (or in your version). I take it you're sure that the data is committed and that you aren't just looking at uncommitted data somehow (possible either within the same session/connection or using READ_UNCOMMITTED transaction isolation)?
All major RDBMS (Oracle, Sybase, MS SQL Server, DB2, Ingres) support transactions by default in my experience. It's only noddy ones like Access and MySQL that don't.
Hope that helps.
Joined: Mar 17, 2004
Hi, thanks for your reply, I got it fixed with con.rollback().
By the way :roll: , have you ever had problems using a PreparedStatement object's setNull()?? I do the following