> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Rupp,Heiko > Sent: 27. januar 2003 18:35 > To: Xdoclet-User (E-Mail) > Subject: RE: [Xdoclet-user] Simple Example of CMR and using it? > > > Aslak, > > thanks very much.. this helped. Basically to find my typos ... > > PersonHome ph; > EmailHome eh; > ... > Person pl = ph.create(name,vorname,persids); > pl.getEmails().add(eh.create(email)); > > > 1) create a new Person (the EJB way via local home interface) > > 2) Create a new Email (the same way) > > 3) person.getEmails().add(email) > > Now I get an Exception java.lang.IllegalStateException: A CMR > collection may > only be used within the transction in which it was created >
Yup, you need a proper transaction scope. The app server doco + the EJB spec + any decent EJB book can tell you more about this. There are also @ejb.transaction tags you can use to set the transaction scope properly. > At this time, the Person entry is fully created and the Email one halfway > (it > is missing its foreign key). I will have to dig into the JBoss > mailing lists > for this. > > Thanks > Heiko > > P.S.: It would help if xdoclet would warn about unknown tags or arguments. That's a planned feature for a future release. > -- > Bancotec GmbH EMail: [EMAIL PROTECTED] > Calwer Str. 33 Telefon: +49 711 222 992 900 > D-70173 Stuttgart Telefax: +49 711 222 992 999 > Ein Unternehmen der Cellent AG http://www.cellent.de/ > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Xdoclet-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/xdoclet-user ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ Xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user
