[JBoss-user] Does CMR Collections have to be accessed (iterated) inside a transaction?

2002-11-05 Thread Victor Batista
Hello!
I am developing two entity beans which have a relatinship 1-N (One User can
have Many Roles).
I have also a Facade session bean to handle the business operations. I have
declared the Transaction property of my beans (Entity and session) as
Supports. The methods which insert or update data are declared as
Required. I don't want read-only operations to be executed inside
transactions.
I have one method (getUser) which returns a VO with the User data and calls
the relation method (getRoles() which returns a Collection of Roles). As
this is a read operation, I don't want a transaction to handle this method.
Although I am having one exception when I try to iterate the list of roles
returned by the getRoles method


java.lang.IllegalStateException: A CMR collection may only be used within
the transction in which it was created


Does CMR collections have to be accessed inside transactions?

Thanks in advance,
Victor Batista





---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power  Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



Re: [JBoss-user] Does CMR Collections have to be accessed (iterated) inside a transaction?

2002-11-05 Thread julien viet
yes they have.

 --- Victor Batista
[EMAIL PROTECTED] a écrit :  Hello!
   I am developing two entity beans which have a
 relatinship 1-N (One User can
 have Many Roles).
   I have also a Facade session bean to handle the
 business operations. I have
 declared the Transaction property of my beans
 (Entity and session) as
 Supports. The methods which insert or update data
 are declared as
 Required. I don't want read-only operations to be
 executed inside
 transactions.
   I have one method (getUser) which returns a VO with
 the User data and calls
 the relation method (getRoles() which returns a
 Collection of Roles). As
 this is a read operation, I don't want a transaction
 to handle this method.
 Although I am having one exception when I try to
 iterate the list of roles
 returned by the getRoles method
 
 
   java.lang.IllegalStateException: A CMR collection
 may only be used within
 the transction in which it was created
 
 
   Does CMR collections have to be accessed inside
 transactions?
 
   Thanks in advance,
   Victor Batista
 
 
 
 
 

---
 This sf.net email is sponsored by: See the NEW Palm 
 Tungsten T handheld. Power  Color in a compact
 size!

http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]

https://lists.sourceforge.net/lists/listinfo/jboss-user 

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power  Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] Does CMR Collections have to be accessed (iterated) inside a transaction?

2002-11-05 Thread Herve Tchepannou
Title: RE: [JBoss-user] Does CMR Collections have to be accessed (iterated) inside a  transaction?





Is this a requirement of EJB standard or just due to JBoss implementation?


-Original Message-
From: julien viet [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 05, 2002 6:16 AM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Does CMR Collections have to be accessed
(iterated) inside a transaction?



yes they have.


--- Victor Batista
[EMAIL PROTECTED] a écrit :  Hello!
  I am developing two entity beans which have a
 relatinship 1-N (One User can
 have Many Roles).
  I have also a Facade session bean to handle the
 business operations. I have
 declared the Transaction property of my beans
 (Entity and session) as
 Supports. The methods which insert or update data
 are declared as
 Required. I don't want read-only operations to be
 executed inside
 transactions.
  I have one method (getUser) which returns a VO with
 the User data and calls
 the relation method (getRoles() which returns a
 Collection of Roles). As
 this is a read operation, I don't want a transaction
 to handle this method.
 Although I am having one exception when I try to
 iterate the list of roles
 returned by the getRoles method
 
 
  java.lang.IllegalStateException: A CMR collection
 may only be used within
 the transction in which it was created
 
 
  Does CMR collections have to be accessed inside
 transactions?
 
  Thanks in advance,
   Victor Batista
 
 
 
 
 

---
 This sf.net email is sponsored by: See the NEW Palm 
 Tungsten T handheld. Power  Color in a compact
 size!

http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
 ___
 JBoss-user mailing list
 [EMAIL PROTECTED]

https://lists.sourceforge.net/lists/listinfo/jboss-user 


___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com



---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power  Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user





Re: [JBoss-user] Does CMR Collections have to be accessed (iterated) inside a transaction?

2002-11-05 Thread Dain Sundstrom
It is in the spec.  It would be easy to support iterating outside of the 
spec, but you would get an inconsistent database on a writeable database.

-dain

Herve Tchepannou wrote:
Is this a requirement of EJB standard or just due to JBoss implementation?

-Original Message-
From: julien viet [mailto:julien_viet;yahoo.fr]
Sent: Tuesday, November 05, 2002 6:16 AM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Does CMR Collections have to be accessed
(iterated) inside a transaction?


yes they have.

 --- Victor Batista
[EMAIL PROTECTED] a écrit :  Hello!
I am developing two entity beans which have a
  relatinship 1-N (One User can
  have Many Roles).
I have also a Facade session bean to handle the
  business operations. I have
  declared the Transaction property of my beans
  (Entity and session) as
  Supports. The methods which insert or update data
  are declared as
  Required. I don't want read-only operations to be
  executed inside
  transactions.
I have one method (getUser) which returns a VO with
  the User data and calls
  the relation method (getRoles() which returns a
  Collection of Roles). As
  this is a read operation, I don't want a transaction
  to handle this method.
  Although I am having one exception when I try to
  iterate the list of roles
  returned by the getRoles method
 
 
java.lang.IllegalStateException: A CMR collection
  may only be used within
  the transction in which it was created
 
 
Does CMR collections have to be accessed inside
  transactions?
 
Thanks in advance,
Victor Batista
 
 
 
 
 
 
---
  This sf.net email is sponsored by: See the NEW Palm
  Tungsten T handheld. Power  Color in a compact
  size!
 
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
  ___
  JBoss-user mailing list
  [EMAIL PROTECTED]
 
https://lists.sourceforge.net/lists/listinfo/jboss-user

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


---
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power  Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user




--

Dain Sundstrom
Chief Architect JBossCMP
JBoss Group, LLC




---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power  Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user