5 Replies Latest reply on Aug 2, 2005 1:30 AM by kaven wong

    A CMR collection may only be used within the transction in w

    Dennis Przybyla Novice

      I am using JBoss 3.2.3 with nukes 1.0 In a nukes module I do something similar and it works but in a service bean that I create this does not work. I get the CMR collection error.

       NoteEJBLocal note = noteHome.create(currentPackage, noteNumber, startTime, stopTime, remarks);
      
       Collection eventLogs = note.getEventLogs();
       EventLogEJBLocal eventLog = EventUtils.logEvent(null, "Note Created", "", "");
       eventLogs.add(eventLog);
       note.setEventLogs(eventLogs);
      


      The reason I don't put the eventLog in the create is that I want to make sure the create is successful before I create the event. It dies on the eventLogs.add(eventLog) line. It gives me the error "A CMR collection may only be used within the transction in which it was created". What am I doing wrong? As I have said it works doing this exact same thing in a nukes module.