[jboss-user] [EJB 3.0] - @Cache on Entity Bean and complex select queries.

vberetti do-not-reply at jboss.com
Wed Sep 13 03:07:22 EDT 2006


Hi,
I annotated my Entity Beans with the
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
and I'd like to know how object are really cached.
In the jboss ejb3 documentation at http://docs.jboss.org/ejb3/app-server/tutorial/clusteredentity/clusteredentity.html  it is said that :
"Any attempt to look up Customer or Contact by their primary key, will first attempt to read the entry from the cache. If it cannot be found it will load it up from the database."
So it seems to me that the cache only handle queries by primary keys.
What happens if I try to get Customer by his age and his name ? Will it use this second level cache or will it in fact act just as if I did not defined "@Cache" annotation on the Customer Entity Bean ?
Thanks,
Vincent.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3971190#3971190

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3971190



More information about the jboss-user mailing list