Hi,
I mailed the list before enquiring about this but I thought I'd try again,
this time narrowing it down a little.
I want to test some code that accesses an entity beans CMR field collection
and iterates through it. This code will be used through a session bean in
the final product but for the junit test I am not using a session bean. The
test works fine in JBoss 3.0.0 but not beyond. This is because the retrival
and accessing of the cmr collection needs to be done within a single
transaction (and prior to JBoss 3.0.1 this was incorrectly not checked for,
it now is) . How can I mimic this in my test case?
Currently I have: (in a junit test extending ServletTestCase i.e. using
cactus)
uTrans = (UserTransaction)new
InitialContext().lookup("java:/comp/UserTransaction");
uTrans.begin();
interestAction = new UpdateInterestAction(memberContext, interest, value);
uTrans.commit();
Whether I use this with or without the usertransaction code I always get the
message:
java.lang.IllegalStateException: A CMR collection may only be used within
the transction in which it was created
Am I retrieving the UserTransaction correctly??
Is it possible that I might be getting the UserTransaction from Jetty (the
one with JBoss) which is being used by cactus to host the test class? I know
that to be able to access JBoss's datasource from within a cactus test case
I
needed to add entries into the web.xml and jboss-web.xml files in the war
file
containing the test code. Do I need to do the same to be able to access the
correct UserTransaction?
Currently using JBoss 3.0.3, on Win 2K, accessing Postgres 7.2.2 (using
current stable release of the postgresql's jdbc drivers for 7.2)
Many thanks,
Tim
-------------------------------------------------------
This sf.net email is sponsored by: Influence the future
of Java(TM) technology. Join the Java Community
Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user