I only added the following method:
public static void clearCache() { if (sequencesMap != null) { sequencesMap.clear(); } }
It should be no problem to add such a method, but I can't change the sequence manager interface (maybe for 1.1), so you have to cast. Maybe we call the method 'reset()' and introduce this method in sequence manager interface for 1.1.
In reset() method depended on the implementation the sequence manager was set to an initial state.
What do you think? Better method name?
regards, Armin
and called it when i destroy the tables, and everything works fine now.
-----Message d'origine----- De : Guillaume Nodet [mailto:[EMAIL PROTECTED] Envoyé : vendredi 23 avril 2004 16:25 À : OJB Users List Objet : Problem with sequence manager
Hi,
In my application, i can dynamically create and drop the tables for storing ojb objects. The problem is that when i insert some data, drop the tables, recreate them, and insert data, the sequence manager is not re-initialized (i use SequenceManagerHighLowImpl) so when inserting data in the newly created tables, the sequence manager reuses caches sequences (in the sequencesMap), instead of creating new ones. So when a sequence runs out of id, it looks into the database, creates a new sequence and thus ids overlapp.
Could it be possible to add a method for clearing the cache of sequences (stored in the sequencesMap attribute) ?
I will for the moment use my own sequence manager (a copy of SequenceManagerHighLowImpl with the above method).
Thanks,
Guillaume
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]