jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Groschupf ...@media-style.com>
Subject outside the scope of a transaction
Date Wed, 18 Aug 2004 16:36:31 GMT
Hi,

I use cactus to test my ejbs in weblogic 8.1 sp2.
There something i could not find any starting point to track down the  
problem.

I have in my test case a line:
  assertEquals(0,  
KitUtil.getLocalHome().findByPrimaryKey(kitLocal.getUniqueSequence()).ge 
tSubscribers().size());
At least I just test a entity n:n entity bean relation in this line.
I got this exception:

[junit]     Caused an ERROR
     [junit] [EJB:010116]Attempted to access the collection valued  
cmr-field, 'subscribers', for bean, 'Kit', outside the scope of a  
transaction. All access to the collection must be performed during the  
transaction in which the collection was initially retrieved.
     [junit] java.lang.IllegalStateException: [EJB:010116]Attempted to  
access the collection valued cmr-field, 'subscribers', for bean, 'Kit',  
outside the scope of a transaction. All access to the collection must  
be performed during the transaction in which the collection was  
initially retrieved.


I was asking already the bea support guys but they suggest do not use  
this kind of strange tools since .... ;-o
They say the the cactus servlet will not run inside a transaction and  
my findbyprimary key run every-time in a transaction.
Thats way there will be no solution for this problem. ;(

I do not comment this answer. ;-(

Anyway it is difficult for me to test my ejbs in case I can not use the  
getter methods that returns collections of other enitity beans.
So far was able to workaround by testing the content of my DTO that was  
generated by a DTOFactory session bean, where I have no problems at  
all.

Someone has any idea what I can do to test getter methods collections  
of entity bean i was finding by primary key?

Thanks for any hints.
Stefan


Mime
View raw message