|
From: Isabelle M. <isa...@me...> - 2003-05-30 14:43:38
|
Hi JP, As a matter of fact I also thought of requiring the equivalent of EJB's Requires New transaction. The problem still is how to implement this: how do I know whether the code is running in a CMP/BMP EJB, under JTA, ... I'm a bit baffled, don't know the answer. There is a solution which makes the whole implementation redundant : for the user to cast the Statement or PreparedStatement to a com.mysql.Statement (PreparedStatement) and then call getLastInsertId(). I don't want to do this in the framework, because then compilation becomes dependent on the mysql JDBC library. Isabelle On Fri, May 30, 2003 at 04:29:30PM +0200, JP Pawlak wrote: > Hi Isabelle, > > Ah, the continuously problematic MaxValueIncrementer ;-) ! > As with the key search we will always have potentially two Sql orders, > how manage this? > The best would be to have the possibility to treat separately. It would > be convenient to assure the key search being out of any transaction and > being committed regardless of a current transaction. In this case, > simply the key(s) used by the rollbacked operations are lost. I don't > know, so quickly, if it is possible and how. > > Jean-Pierre > > > > -----Message d'origine----- > > De : spr...@li... > > [mailto:spr...@li...] > > De la part de Isabelle Muszynski > > Envoyé : vendredi 30 mai 2003 15:28 > > à : spr...@li... > > Objet : [Springframework-developer] Problem with > > MySqlMaxValueIncrementer > > > > > > 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 > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: eBay > > Get office equipment for less on eBay! > > http://adfarm.mediaplex.com/ad/ck/711-11697-> 6916-5 > > > > _______________________________________________ > > > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > -- 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 |