i'm not sure how you're exactly accessing the various beans n methods, but you
mention something that will point to the solution:
anonymous wrote :
| Calling the CMR method getAddenda() that returns the Set works
| perfectly from another bean, but I would like to call it from custom
| JSP tags in the web tier of the same server. When I try this, I get the
| following exception:
The act of instantiating a collection of related objects and then retrieving
the value objects from that collection must be done in the same transaction.
I suspect that when you call the 'getAddenda()' method from another bean, the
methods on that bean require a transaction. You can check your configuration
for this.
However, I'm not sure, but I suspect that servlets (e.g., JSP pages) do not
wrap entire methods in a transaction. You'll have to do this yourself.
I was running into the same sort of problem running JunitEE tests. I had to
augment my JunitEE tests with something like the following (code example not
complete):
| Context ic = new InitialContext();
| tx = (UserTransaction) ic.lookup ("java:comp/UserTransaction");
| tx.begin();
|
| AccountLocal lObj = home.findByPrimaryKey(objKey);
| AccountValue vObj = lObj.getAccountValue();
| tx.commit();
|
this is because I had created value objects for another bean (1:n) related to
Account. sooo, the 'getAccountValue()' method also retrieves value objects for
the Account children, all in one method call.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3932240#3932240
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3932240
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user