Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP synchronized update  RSS feed

 
sonali neel
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm updating an ACCESS table in JSP and in the same JSP trying to retrieve the updated value. The table is seen to be updated but somehow, the new data is not selected in JSP.
I have used conn.commit() after my update. However the changes do not seem to be committed. Is there a trick to it??
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could be running into a common problem with Access.
Try one of the following:
1) set autocommit to true before using any connections
2) execute and 'empty select' on the same Connection after the update
ie 'update etc etc' then 'select id from table where id=1'
3) do another update
The last is less likely, but it appears the JDBC-ODBC bridge doesn't always flush the last operation, so you have to to one more. You'd see the same behaviour in inserts. If you're doing multiple inserts and updates, do them all and one more select at the end.
My preferred solution is (besides not using Access) setting autocommit to true for Access databases.
Dave
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!