|
From: Isabelle M. <isa...@me...> - 2003-05-30 13:52:47
|
Hi everyone, There is a problem with MySQLMaxValueIncrementer (and I think with the Oracle one as well). Currently the code doesn't do any transaction management which has 3 consequences : (1) if the calling code does a rollback, the value(s) cached in / handed out by the object are invalid (2) the code requires the caller to do a commit, which I'm sure most people will forget to do if using the framework. (3) when requesting a bunch of keys, it is possible to get a series of non-sequential numbers from the database. This because of the loop in the code, which is requred by mySQL last_insert_id() semantics. This particular problem could be solved by maintaining an array of values, instead of just a maxId. I'll make this change over the weekend. This particular problem won't show up in the Oracle implementation. I'm not sure how to solve the items 1 & 2 though. The code can be called in a variety of circumstances (BMP and CMP beans, no EJB, ...). Can we even assume the presence of a transaction manager? Any ideas? -- Isabelle Muszynski Software Engineer Zandweellaan 4 2660 Antwerpen Belgium Tel. 32-(0)3-830 18 54 Mobile: 32-(0)485 49 50 89 Email: isa...@me... Website: www.meta-logix.com |