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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strange problem: saving data locks the DB entry

Status
Not open for further replies.

Smoerble

Programmer
Jul 19, 2001
8
DE
hey all...
i have the following problem:
i wrote a samll CMS-system. there's a section where users can define how the page will look like.
for this they can store main HTML-code and the HTML-code for the navigation.
both are stored in the access-file in the table "designs", as so called "MEMO"-fields (no LOngVarCHar in access-files).

table: designs
cols: designId, designHtml, designNavigation

user insert the code by using a simple "textarea"-field.
it runs perfectly if i just save one filed: if i only store data all the time for the main HTML-part no prob here. i can recall it and save it againa nd againa and again, no prob.
as soon as i store the navigation-code too (using UPDATE-command) i get the following error-msg:

"Could not save; currently locked by user 'admin' on machine 'GANAG-OG2I04NUN'."

you can see the code of the two files (really simple ones) here:

would be really really cool if anyone could help me, i can't get it working for mroe than a week now :(
cya
Michael 'Smoerble' Stock
 
Three Comments:

1) Access is a terrible database to use as a web backend. It has the bad problem of getting locked for apparently no reason at times. You should be using a better RDBMS like MySQL(free).

2) This problem is a prime example of why you shouldn't do your logic and esspecially your SQL statements in JSP pages. It the very least place all of your real code in JavaBeans and call them from the JSP. First verify that the Bean works properly and then add it to your JSP. I perfer to take it one step further and implement a MVC design where the JSP is only used for presentation and makes no calls to other components.

3) My recommendation is to take out your update code and put it in regular Java Classes (ala #2). Test and make sure it works. If I had to guess at the problem I would say it is either Access open on the Server (doesn't seem likely in your case) or a Connection somewhere is not being closed. Like I said in number 1, Access is very prone to locking.

4) Did I mention you shouldn't use Access? Wushutwist
 
oh, i didn't meantioned that i hate access too :)
thx anyway i will do this... unfortunatly i'm not good in coding real java so maybe you know a workaround in JSP for the next 3 weeks for me (far away from PC in that time, argl ! ;)?

anyhow i will check for unclosed connections again
 
ok, i missed the Close() tag but this didn't help, still crashes...

other ideas ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top