Closing all the db handlers was one of the first things that I did. Your second suggestion is interesting. I will give that a try. Right now I have db calls in the main thread as well as multiple worker threads and I believe this is where I'm running into issues.
I guess that would mean I would have to push all my result set iterations into that single thread as well. I guess I'm still to sequential in my thinking it should be more object oriented. On Aug 4, 4:47 am, Eduard Martini <[email protected]> wrote: > 1. Close ALL db handlers before opening a new one (rs = db.execute > (....); do_things; rs.close();) > > 2. First one will solve 90% of your locking problems. To get rid of > all, you need to make a worker and move ALL db interactions there. > Whenever you need something from DB you will send a message to that > worker. > > On Jul 31, 9:59 pm, jungleforce <[email protected]> wrote: > > > I hope this is the right place to ask developer questions. > > > I've built up a fairly substantial application using gears, but I'm > > running into database locking issues and am wondering if anyone has > > come up with strategies to resolve these locks. > > > I have both a main thread and a worker thread that needs to access the > > database, and it seems either the threads are trying to access the > > database at the same time or I haven't released the access to the > > database correctly. > > > I guess one solution would be to write a function to handle all db > > requests so that it uses a Try/Catch loop until successful. > > > What do you think?
