|
From: JP P. <jp....@ti...> - 2003-05-30 14:51:25
|
At this point, Rod or Juergen will certainly be more helpful as AOP will = certainly have to enter in the dance. Jean-Pierre > -----Message d'origine----- > De : Isabelle Muszynski [mailto:isa...@me...]=20 > Envoy=C3=A9 : vendredi 30 mai 2003 16:43 > =C3=80 : JP Pawlak > Cc : spr...@li... > Objet : Re: RE : [Springframework-developer] Problem with=20 > MySqlMaxValueIncrementer >=20 >=20 > Hi JP, >=20 > As a matter of fact I also thought of requiring the=20 > equivalent of EJB's Requires New transaction. The problem=20 > still is how to implement this: how do I know whether the=20 > code is running in a CMP/BMP EJB, under JTA, ... I'm a bit=20 > baffled, don't know the answer. >=20 > There is a solution which makes the whole implementation=20 > redundant : for the user to cast the Statement or=20 > PreparedStatement to a com.mysql.Statement=20 > (PreparedStatement) and then call getLastInsertId(). I don't=20 > want to do this in the framework, because then compilation=20 > becomes dependent on the mysql JDBC library. >=20 > Isabelle >=20 > On Fri, May 30, 2003 at 04:29:30PM +0200, JP Pawlak wrote: > > Hi Isabelle, > >=20 > > Ah, the continuously problematic MaxValueIncrementer ;-) ! > > As with the key search we will always have potentially two=20 > Sql orders,=20 > > how manage this? The best would be to have the possibility to treat=20 > > separately. It would be convenient to assure the key search=20 > being out=20 > > of any transaction and being committed regardless of a current=20 > > transaction. In this case, simply the key(s) used by the rollbacked=20 > > operations are lost. I don't know, so quickly, if it is=20 > possible and=20 > > how. > >=20 > > Jean-Pierre > > =20 > >=20 > > > -----Message d'origine----- > > > De : spr...@li... > > > [mailto:spr...@li...] > > > De la part de Isabelle Muszynski > > > Envoy=C3=83=C2=A9 : vendredi 30 mai 2003 15:28 > > > =C3=83=E2=82=AC : spr...@li... > > > Objet : [Springframework-developer] Problem with=20 > > > MySqlMaxValueIncrementer > > >=20 > > >=20 > > > Hi everyone, > > >=20 > > > There is a problem with MySQLMaxValueIncrementer (and I think > > > with the Oracle one as well). Currently the code doesn't do=20 > > > any transaction management which has 3 consequences : > > > (1) if the calling code does a rollback, the value(s) cached=20 > > > in / handed out by the object are invalid > > > (2) the code requires the caller to do a commit, which I'm=20 > > > sure most people will forget to do if using the framework. > > > (3) when requesting a bunch of keys, it is possible to get a=20 > > > series of non-sequential numbers from the database. This=20 > > > because of the loop in the code, which is requred by mySQL=20 > > > last_insert_id() semantics. This particular problem could be=20 > > > solved by maintaining an array of values, instead of just a=20 > > > maxId. I'll make this change over the weekend. This=20 > > > particular problem won't show up in the Oracle=20 > > > implementation. I'm not sure how to solve the items 1 & 2=20 > > > though. The code can be called in a variety of circumstances=20 > > > (BMP and CMP beans, no EJB, ...). Can we even assume the=20 > > > presence of a transaction manager? > > >=20 > > > Any ideas? > > >=20 > > >=20 > > > -- > > > 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 > > >=20 > > >=20 > > > ------------------------------------------------------- > > > 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 > > >=20 > > > _______________________________________________ > > >=20 > > > Springframework-developer mailing list > > > Spr...@li... > > >=20 > https://lists.sourceforge.net/lists/listinfo/s> = pringframework-developer > > >=20 > >=20 > >=20 > >=20 > >=20 >=20 > --=20 > 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 >=20 |