|
From: Dmitriy K. <dko...@ru...> - 2004-02-28 22:42:34
|
+1 for JdbcResourceException to be consistent with Spring Exception hiera= rchy=2E=2E=2E Regards=2C Dmitriy=2E ----- Original Message ----- From=3A trisberg=40tridb=2Ecom Date=3A Saturday=2C February 28=2C 2004 5=3A08 pm Subject=3A Re=3A =5BSpringframework-developer=5D DataFieldMaxValueIncreme= nter =3E = =3E It=27s not necessarily a bad argument though - it could just be that = =3E the runtime =3E environment is misconfigured - I think a JdbcResourceException = =3E (see previous =3E email) would be appropriate=2E =3E = =3E Thomas =3E = =3E Quoting =22j=C3=BCrgen h=C3=B6ller =5Bwerk3AT=5D=22 =3Cjuergen=2Ehoel= ler=40werk3at=2Ecom=3E=3A =3E = =3E =3E But the javax=2Esql=2EDataSource interface is plain JDBC=2C typic= ally = =3E to be =3D =3E =3E used by Spring DAOs just like any other DataSource=2E It=27s = =3E getConnection =3D =3E =3E methods throw SQLException=2C according to the DataSource interfa= ce=2E =3E =3E =3D20 =3E =3E This is about *setting up* a DriverManagerDataSource=3B I don=27t= = =3E see why =3D =3E =3E setDriverClassName or the constructor should throw a = =3E DataAccessException =3D =3E =3E here=2E Other Spring beans - including DAO support classes - thro= w =3D =3E =3E IllegalArgumentException or the like too when they get bad = =3E configuration =3D =3E =3E parameters on initialization=2E =3E =3E =3D20 =3E =3E As I said=2C I changed DriverManagerDataSource initialization to = =3E throw =3D =3E =3E IllegalArgumentException=2C after Thomas=27 remark=2E The kind of= = =3E unchecked =3D =3E =3E exception thrown on initialization is a rather academic issue=2E=2E= =2E = =3E In =3D =3E =3E particular=2C if the driver class name isn=27t right=2C you can=27= t do = =3E anything =3D =3E =3E meaningful anyway=2E =3E =3E =3D20 =3E =3E Juergen =3E =3E =3D20 =3E =3E = =3E =3E =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F =3E =3E = =3E =3E Von=3A springframework-developer-admin=40lists=2Esourceforge=2Ene= t im = =3E Auftrag =3D =3E =3E von Rod Johnson =3E =3E Gesendet=3A Sa 28=2E02=2E2004 22=3A33 =3E =3E An=3A springframework-developer=40lists=2Esourceforge=2Enet =3E =3E Betreff=3A Re=3A =5BSpringframework-developer=5D = =3E DataFieldMaxValueIncrementer=3E = =3E =3E = =3E =3E = =3E =3E = =3E =3E = =3E =3E = =3E =3E =3EGood point - changed to IllegalArgumentException=2E =3E =3E = =3E =3E =3EI just didn=27t want to throw CannotGetJdbcConnectionException= = =3E like =3D =3E =3E before=3B =3E =3E it arguably wasn=27t appropriate=2E In general=2E the DataSource = =3D =3E =3E implementations =3E =3E shouldn=27t use DataAccessExceptions in the first place=2E =3E =3E = =3E =3E I disagree=2E I think that the user should be able to catch =3E =3E DataAccessException confidently in all cases (which was why I = =3E changed =3D =3E =3E from =3E =3E ClassNotFoundException to a DataAccessException)=2E =3E =3E = =3E =3E I don=27t have terribly strong views on this as it=27s not a = =3E production =3D =3E =3E usage =3E =3E class anyway--but that also implies it wasn=27t really worth = =3E changing the =3E =3E behaviour either=2E=2E=2E =3E =3E = =3E =3E = =3E =3E = =3E =3E = =3E =3E ------------------------------------------------------- =3E =3E SF=2ENet is sponsored by=3A Speed Start Your Linux Apps Now=2E =3E =3E Build and deploy apps =26 Web services for Linux with =3E =3E a free DVD software kit from IBM=2E Click Now! =3E =3E http=3A//ads=2Eosdn=2Ecom/=3Fad=5Fid=3D3D1356=26alloc=5Fid=3D3D34= 38=26op=3D3Dclick =3E =3E =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =3E =3E Springframework-developer mailing list =3E =3E Springframework-developer=40lists=2Esourceforge=2Enet =3E =3E https=3A//lists=2Esourceforge=2Enet/lists/listinfo/springframewor= k- =3E developer=3E = =3E =3E = =3E =3E = =3E =3E = =3E =3E ------------------------------------------------------- =3E =3E SF=2ENet is sponsored by=3A Speed Start Your Linux Apps Now=2E =3E =3E Build and deploy apps =26 Web services for Linux with =3E =3E a free DVD software kit from IBM=2E Click Now! =3E =3E http=3A//ads=2Eosdn=2Ecom/=3Fad=5Fid=3D1356=26alloc=5Fid=3D3438=26= op=3Dclick =3E =3E =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =3E =3E Springframework-developer mailing list =3E =3E Springframework-developer=40lists=2Esourceforge=2Enet =3E =3E https=3A//lists=2Esourceforge=2Enet/lists/listinfo/springframewor= k- =3E developer=3E = =3E = =3E = =3E = =3E = =3E = =3E ------------------------------------------------------- =3E SF=2ENet is sponsored by=3A Speed Start Your Linux Apps Now=2E =3E Build and deploy apps =26 Web services for Linux with =3E a free DVD software kit from IBM=2E Click Now! =3E http=3A//ads=2Eosdn=2Ecom/=3Fad=5Fid=3D1356=26alloc=5Fid=3D3438=26op=3D= click =3E =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F =3E Springframework-developer mailing list =3E Springframework-developer=40lists=2Esourceforge=2Enet =3E https=3A//lists=2Esourceforge=2Enet/lists/listinfo/springframework-de= veloper =3E |