Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2003 and Java servlet database connection 1

Status
Not open for further replies.

thrybergh

MIS
Feb 10, 2003
52
GB
Hi

I have a web app which uses an Access 2003 database. It works well enough and I can query it via a form with supplied parameters.

However, the actual .mdb file is stored on a file server and I have setup and ODBC data source for my servlet. The .mdb file is edited independently (from the web app) by users who have an Access front-end. What I have found is that unless I re-start the Tomcat server, any new changes made via the Access front-end are not available to the web app.

Is this a fault with my servlet database connection? I am doing something wrong in my code, or is there a setting on the Access database (like a COMMIT setting) that needs changing? I do not know very much about the technical side of Access.

Any tips would be appreciated!

 
Chances are that Tomcat believes it has locked the file for against editing in the fashion you describe and is cacheing a lot of data. Access used to be, and unless they've changed it a *lot* since I last looked it over should still be, a single-user database. Having Tomcat believe that it's that user and then allowing other users to edit the raw file seems a basic violation of that principle - I'm surprised Tomcat hasn't managed to corrupt the thing yet.

In short, if it needs editing, either do it all through Tomcat or lock Tomcat out while there's a lockfile and refresh Tomcat after the edit's done. You might be able to set your Tomcat up better to help with this, but I doubt there's a thing Access can do for this problem.
 
As far as I know, Access supports multiple users for some years now, but it isn't a real or normal database.

There isn't a server running, answering to requests, and it is only useful for small prototypes, few users, and few data.

seeking a job as java-programmer in Berlin:
 
The company I work for has been using an in-house Access database multi-user since 1997. It did tend to corrupt fairly frequently in the early days, but is more stable now.

I think stefanwagner is correct. There is no 'server' mode in Access which can provide timely response to the JDBC requests you're firing at it. (Maybe someone could correct me if I'm wrong). Is there any mileage in using something like MySQL for your data. Tomcat could use this nicely, and maybe your existing Access database could use ODBC table links to it in place of the existing static tables to allow your users to continue using the Access front-end? Not sure how stable this would be though.

Any thoughts, sedj? This is one of your areas of expertise I think.

Tim
 
Thanks for the advice.

I think I will ask the users who update the database to restart the application via the Tomcat manager after their changes.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top