Hello!

Am 30.07.2006 um 18:40 schrieb mos:

The Cayenne framework is using a a single table to keep the primary
keys (PK) for its objects. The method accessing this table is
surrounded by lock / unlock commands, so no other thread can read the
same PK from the table while another thread is currently reading and
incrementing the PK. Each thread accessing the table is incrementing
the value by 20 for caching PK values to reduce the load on the
database.

I assume you are using WRITE locks and not READ locks, correct? Because READ locks won't prevent other threads from reading the table value. Something like this should work: (I'm using MyISAM but it should still work with InnoDb.)

It's also a read lock, no thread can read the table until the the unlock command has been issued. This has been tested in functionality as well as load tests already.


When you lose the connection and reconnect, can you not clear the cache for the autoinc table so it gets the current value?

The framework does that, after reconnecting it does reread the PK values. The problem must be somewhere else...

Christian






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to