Hi,

As I understand it you have to access the Collection in the same transaction as
in which it gets created.

2 options I know of available to you is:
1) Return collection of value objects and iterate over those.
2) Do the CMR access in a UserTransaction. 

I did the 1st one as I'm not that familiar with 2.

On Fri, Nov 14, 2003 at 04:14:59PM -0800, Balakrishnan, Vijay wrote:
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg22637.html
> 
> Hi,
> 
> I am getting a very similar error to the thread above:
> java.lang.IllegalStateException: A CMR collection may only be used within
> the transction in which it was created
>       at
> org.jboss.ejb.plugins.cmp.jdbc.bridge.RelationSet.getIdList(Unknown Source)
> 
> I have a Message driven bean with Commit Option A and onMessage method with
> a transaction attribute set to "Required" as follows:
> * @ejb.transaction type="Required"
> 
> 
> Here is the relevant code snippet from the onMessage method:
> 
> ItemLocal itemLocal = cpeLocal.getItemLocal();
> Collection cpes = itemLocal.getCpesLocal();
>                         
> Iterator iterator = cpes.iterator(); <==== fails here with the exception
> above
> 
> 
> Thanks in advance,
> Vijay
>                         
> 
> 
> -------------------------------------------------------
> This SF. Net email is sponsored by: GoToMyPC
> GoToMyPC is the fast, easy and secure way to access your computer from
> any Web browser or wireless device. Click here to Try it Free!
> https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user

-- 
Alwyn Schoeman
SMART Money Inc.

If you're a SMARTY and you're using the better DNS connections, you
can access my homepage at http://nevyn.smarties.com.ph/Members/alwyn.
The other unlucky ones: http://10.126.68.24/myplone


-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to