First, the re-fetch you see between your two tests is because of the 
commit option. Option B (default in 3.0) doesn't cache data between 
transactions, although the bean instances will be cached. If you aren't 
clustering and your data can't be modified from anywhere else, you can 
change standardjboss.xml to use Option A instead.

As to why you need the user transaction, what kind of object are you 
calling from? If it's a client, well then you need a UserTransaction. If 
it's a session bean, then make sure your session bean's method is in a 
transaction with type of Required or RequiresNew.

hth,
danch

Frank Morton wrote:
> 
> If I wrap it with a UserTransaction, things look good, but I don't
> see why I would have to do so. And, if I do, I have many places
> where I will have to do the same thing, which I would like to avoid.
> 
> Without wrapping in my own transaction, when trying to get a single
> property from a single element in the Collection, it loads the whole
> Collection. I don't understand why it would do it twice, let alone
> for each element in the Collection. I also don't understand if it
> is a function of the commit options, config or it is not working
> as expected.



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to