-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Le 10/07/2011 02:32, Jack a écrit :
> Is using JDBC to access database more efficient than using
> Spring/hibernate?
Usually, Hibernate is the very most efficient.
Hibernate use 2 levels of cache to store query results and retrieved
objects.
For example, if you fetch one object, modify it 100×, and then delete
it, Hibernate does only 2 requests : select and delete. All update are
useless.
An other example is retrieving the same object 100× generate only one
select the first time, all others accesses using the Hibernate cache to
find the object.
But Hibernate could be very inefficient if your mapping is badly done.
Lazy loading could collapse your database engine under thousands of
short queries to fetch all children of one object.
On the opposite, eager loading could fetch the ¾ of your database only
with one query.
Hibernate is more efficient if you use it correctly.
- --
Aeris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJOGY4dAAoJEK8zQvxDY4P9dhUH/2FfGAO1NoM1HUEoK8518b8R
KOb4fXcEwE6L19SAOIrPWngbuhtdq1InO/we7sDogUfsqQJVyIGLT26hJ37e6Ppi
V27IYabTMMC+GMaPAx3mK7JnHr26T6+UvlaoENdJ5zzV/1yCZZLuBglSrOg24nsg
QiTd71rqMe7Vnjuaiurxr473vaVX3jASRoi0Y0lHvsBbX4cyog nO3pxV/fzD0v+R
9+MbbqE0JnReU99BP9s0vlrpJy2tioQzT0KP0pPJHwHQU8eBky OsT7A54jxrxJRf
L/5G6EoEQgLKLRVsT/mMKW8jowIyYDtX4wBxb/xGQtLxbDFGjhppCwYWAnby44Q=
=puE0
-----END PGP SIGNATURE-----