I don't think that simply finding the bean (i.e. findByPrimaryKey or otherwise) will
enlist the entity in the cache. You must call some member method of that bean for
this to happen (i.e. myEntity.getId()).
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3826684#3826684";>View
the ori
O_O
Let me explain my need and why I think something is weird there.
We create an entity X and this one has CMR link to other entity (i.e. foreign key).
Before creation this entity, the session bean validates those CMR links (i.e. the Ids
of those entity exists in the DB). So each time I create
How are you getting the FK ids? When you get your entity X, say through:
EntityLocal x = xHome.findByPrimaryKey(xId);
Do you then get your FKs through
x.getId2()
x.getId3()
? If so, I don't understand then. The CMR I am familiar with makes that unecessary,
unpossible. The container will ma
Let's say I want to create a Book. A book as a CMR link to an editor and to an author
for instance. I receive the following XML
John Smith
ABC
[... other non CMR links]
The session bean that parses this XML validates the fact the author and the editor
exists (that way I prevent a creat
I see what you are saying. It's my understanding that regardless of the cache, a
findByPrimaryKey() will always hit the database.
I think that the reason for this is that a findByPrimaryKey() will return a handle,
but not necessarily load the object; that happens when a method is invoked upon t
My understanding of this is the following:
In order for a Bean to be in the cache a method must have been called on the bean
found. So just doing findByPrimaryKey is not enough to load the bean into cache.
Once you have done findByPrimaryKey and called a method on the resulting entity,
subsequ
I think an entity is cached only when a getter is called.
Also, I am not sure if commit option A works with Instance Per Transaction. this
combination was not allowed earlier but i havent used the recent releases of jboss so
i dont know if it is possible now.
View the original post :
http://ww