JBoss 2.4.x

Why does findByPrimaryKey() always result in a 'select count()....'-query on the database? Is it really needed due to the spec?

I mean, I've told the app server (by using commit option A) that no one else but the app server is touching the database. So... if the app server has an entity with say the primary key xyz and I'm doing a findByPrimaryKey("xyz") then the app server should be able to look in cache __first__ to see if it is there. If it is it also must be in database (since commit option A). If it is not in cache, then execute the exists-query against database and the normal stuff...

I've just enlighten a couple of java developers to use the findByPrimaryKey() __as_much_as_possible__ to avoid db-access to start using the cache at max. They where often using other findByXXX's querying on non-pk but still unique fields. And then they tested it and asked me - 'why is it still doing all those select count() stuff?'. And I didn't actually know what to say...

Am I wrong? Or perhaps this is handled different in JBoss 3 serie (actually don't tested it - shame on me)?

/Lennart



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to