[jboss-user] [EJB/JBoss] - Problem with transaction

argonist do-not-reply at jboss.com
Wed Oct 24 09:15:38 EDT 2007


Hello,

Two methodes from plain java class should access into requetBean to fetch/store the data into/from db. At the transaction issue, the second methode "findUserGroup" cannot be called, because it are already in the active transaction. Have you an idea to solve that problem?

Error message:
anonymous wrote : 
  | "Caused by: java.lang.reflect.UndeclaredThrowableException
  |     at $Proxy407.createRawRequest(Unknown Source)
  |     at de.kirchedlau.ponte.utils.convertExceltoDB.sheetToRawRequest(convertExceltoDB.java :121)
  |     at de.kirchedlau.ponte.utils.convertExceltoDB.sheetToEntity(convertExceltoDB.java:102)
  | ...
  | ...
  | 
  | Caused by: java.io.NotSerializableException: de.kirchedlau.ponte.ejb.entities.admin.UserGroup
  |     at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
  | ...
  | ...
  | ...
  | 


  |     // methode is called
  |     private void sheetToRawRequest(Sheet sheet) {
  |         RequestInterface requestSession = (RequestInterface) sessionhandler.requestSession;//  adresse of RequestBean
  | 
  |         if (requestSession == null) {
  |             System.out.println("RequestInterface authsession does not exist");
  |             return;
  |         }
  |         requestSession.deleteAllRawRequests();                                                                   // Access to methode of bean
  | 
  |         for (int i = 0; i < sheet.getRows(); i++) {
  | 
  |             Cell[] row = sheet.getRow(i);
  |             RawRequest request = rowToRawRequest(row);       // that methode is called and more above                                         
  |             if (request != null) {               
  |                 requestSession.createRawRequest(request);                                                // Accessing the methode of requestBean
  |                 System.out.println("RawRequest added: " + request.getAbout());                   
  |             } else {                                                                                                          
  |                 System.out.println("Error in line " + i);
  |             }
  |         }
  |     }
  |    
  |     private RawRequest rowToRawRequest(Cell[] row)
  |     {
  |         RawRequest request = new RawRequest();
  |         ...
  |         ...
  |         ...
  | 
  |         // Column 12: Group
  |         if(numOfColumns > 11){
  |             UserGroup userGroup = requestsession.findDefaultUserGroup();       // Access to RequestBean. That is problem
  |             request.setUserGroup(userGroup);                                                 // Es definiert auch in der RequestInterface
  |         }
  |         return request;
  |     }
  | 

Thank you in advance

Manu

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4098298#4098298

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4098298



More information about the jboss-user mailing list