• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP synchronized update

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
I don't even know how to spell CIA. But this tiny ad does:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic