|
From: <jue...@we...> - 2004-02-28 16:11:22
|
Good point - changed to IllegalArgumentException. I just didn't want to = throw CannotGetJdbcConnectionException like before; it arguably wasn't = appropriate. In general. the DataSource implementations shouldn't use = DataAccessExceptions in the first place. =20 Juergen =20 ________________________________ Von: spr...@li... im Auftrag = von tri...@tr... Gesendet: Sa 28.02.2004 14:06 An: spr...@li... Betreff: Re: [Springframework-developer] DataFieldMaxValueIncrementer Juergen, You broke all my existing tests :-) The DriverManagerDataSource now = throws a ClassNotFoundException which is a checked exception. It used to rethrow = this as an unchecked exception. I can live with this change, but do we want to = change this behavior at this point? As for the Incrementers - I'm going totest them today. Thomas Quoting "j=FCrgen h=F6ller [werk3AT]" <jue...@we...>: > I've committed the revised DataFieldMaxValueIncrementer hierarchy. = There =3D > is a new AbstractSequenceMaxValueIncrementer now, with no value cache = =3D > anymore. OracleSequenceMaxValueIncrementer and =3D > PostgreSQLSequenceMaxValueIncrementer are very simple classes of this = =3D > new base class. In general, there's significantly less code involved = =3D > than before. > =3D20 > I've decided to implement AbstractSequenceMaxValueIncrementer based on = =3D > plain JDBC, to be able to throw proper sequence-related exceptions. A = =3D > queryForLong wouldn't be a particularly useful extension of =3D > JdbcTemplate, and it would throw DataAccessApiUsageExceptions if no = row =3D > found or the like - not appropriate when the user didn't specify the = =3D > query in the first place. > =3D20 > I've also written unit tests for all incrementers. I just did a live = =3D > test of HsqlMaxValueIncrementer; gonna test MySQLMaxValueIncrementer = =3D > later today. Dmitriy, Thomas, could you have a look at the revision, = and =3D > test OracleSequenceMaxValueIncrementer (and possibly =3D > PostgreSQLSequenceMaxValueIncrementer). > =3D20 > Juergen > =3D20 > > ________________________________ > > Von: spr...@li... im Auftrag = =3D > von Dmitriy Kopylenko > Gesendet: Do 26.02.2004 14:33 > An: spr...@li... > Betreff: RE: [Springframework-developer] DataFieldMaxValueIncrementer > > > > +1 for removing cache from sequence-based incrementers > > -----Original Message----- > From: spr...@li... > [mailto:spr...@li...] On = Behalf =3D > Of > j=3DFCrgen h=3DF6ller [werk3AT] > Sent: Thursday, February 26, 2004 2:43 AM > To: spr...@li...; > spr...@li... > Subject: Re: [Springframework-developer] DataFieldMaxValueIncrementer > > > Actually, MySQLMaxValueIncrementer does leverage the value cache in a > meaningful way, and HsqlMaxValueIncrementer at least just issues a =3D > single > delete for the entire advance cache. But the sequence-based =3D > incrementers, > i.e. OracleSequenceMaxValueIncrementer and the new > PostgreSQLSequenceMaxValueIncrementer do not benefit from the value = =3D > cache at > all. So I just suggest to remove the value cache from the = sequence-based > incrementers. > > Juergen > > > ________________________________ > > Von: spr...@li... im Auftrag = =3D > von > j=3DFCrgen h=3DF6ller [werk3AT] > Gesendet: Do 26.02.2004 08:25 > An: spr...@li... > Betreff: Re: [Springframework-developer] DataFieldMaxValueIncrementer > > > > I'm done with the simplicication so far - less than half of the code = =3D > remains > ;-) > > However, there's still the value cache. I strongly doubt that this is = a =3D > good > idea, particularly with database sequences. Essentially, if the cache = =3D > size > is 10, we're accessing the sequence 10 times in advance instead of =3D > asking in > whenever an id is requested. There's the same amount of SQL statements > involved; what's the benefit here? > > The drawback is that we need to synchronize cache access for this. If = we > simply went straight to the database sequence for each id, we could = =3D > delegate > concurrency to the database. And I don't know of an O/R mapping tool = =3D > that > does such sequence value caching (please correct me if I'm wrong). All > things considered, I suggest to drop the value cache completely. > > Juergen > > > ________________________________ > > Von: spr...@li... im Auftrag = =3D > von > tri...@tr... > Gesendet: Mi 25.02.2004 23:02 > An: spr...@li... > Betreff: Re: [Springframework-developer] DataFieldMaxValueIncrementer > > > > > +1 > > I never understood the need for a double as an incrementer anyway. = =3D > Simple > is better. The OracleSequenceMaxValueIncrementer could use some =3D > refactoring > too. We don't need a SqlFunction - we should be able to use the new > queryForXxxx methods on the JDBC Template. Once you check in your =3D > changes, > I can take a look at the Oracle one. > > Thomas > > Quoting "j=3DFCrgen h=3DF6ller [werk3AT]" = <jue...@we...>: > > > I've added PostgreSQLSequenceMaxValueIncrementer today, as attached = to > > =3D3D our JIRA. On the occasion, I've reviewed the incrementer =3D3D > > implementations: They're too complicated for what they achieve, = =3D3D > > IMO.Thus, I've dropped the inner class NextMaxValueProviders and = moved > > =3D3D the code to the DataFieldMaxValueIncrementer class hierarchy = =3D > itself. > > =3D3D20 I've noticed that AbstractDataFieldMaxValueIncrementer's > > nextDoubleValue =3D3D effectively returns an integer, like > > nextIntValue/nextLongValue - after =3D3D all, the template method > > getNextKey returns a long, so there's no chance =3D3D for a true = double. > > Thus, I see no point in keeping the nextDoubleValue =3D3D method in = the > > DataFieldMaxValueIncrementer interface; all current =3D3D =3D > implementations > > do not return doubles here. =3D3D20 > > Furthermore, why does getNextKey take a type parameter when it = returns =3D > a =3D3D > > long anyway? Any JDBC driver will let you read both an int and a = long =3D > =3D3D > > via rs.getLong, so there's no point in that type parameter. Simply = =3D3D > > reading the value via getLong should be sufficient. > > =3D3D20 > > This leaves a very simple DataFieldMaxValueIncrementer interface = with =3D > =3D3D > > nextIntValue, nextLongValue and nextStringValue methods, with =3D3D > > implementations that achieve their goal in a straightforward = fashion. =3D > =3D3D > > AbstractDataFieldMaxValueIncrementer delegates all three to = getNextKey =3D > =3D3D > > which returns a long, casting the long to an int respectively =3D > converting =3D3D > > it to a string with optional padding. > > =3D3D20 > > This should still cover all current usages and therefore not break = =3D3D > > compatibility, and it should make it as easy as possible to = implement =3D > an =3D3D > > AbstractDataFieldMaxValueIncrementer subclass for a specific = database. =3D > =3D3D > > Thomas, Dmitrity, what do you think? > > =3D3D20 > > Juergen > > =3D3D20 > > P.S.: > > Obviously, 1.0 RC2 won't be released tonight but rather at the end = of =3D > =3D3D > > the week. I believe it's worth it, as I'd also like to wait for =3D > feedback =3D3D > > on the other recent changes. > > =3D3D20 > > > > > > ------------------------------------------------------- > > SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and > > deploy apps & Web services for Linux with a free DVD software kit = from > > IBM. Click Now! =3D > http://ads.osdn.com/?ad_id=3D3D1356&alloc_id=3D3D3438&op=3D3Dclick > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > = https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=3D3D1356&alloc_id=3D3D3438&op=3D3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=3D1356&alloc_id438&op=3D3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=3D1356&alloc_id438&op=3D3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=3D1356&alloc_id438&op=3D3Dick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > SF.Net is sponsored by: Speed Start Your Linux Apps Now. > Build and deploy apps & Web services for Linux with > a free DVD software kit from IBM. Click Now! > http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=3D1356&alloc_id=3D3438&op=3Dclick _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |