BMP transaction prob in Jboss 3.0.0beta2
rinehart Apr 6, 2002 6:49 PMI'm having a problem with transactions and BMP entity beans. I just got the build today, and ran clean before rebuilding.
In my source I invoke a find, which works. I think try to get fields of the entity bean through the remote interface. With trace turned on, I can see that the finder is invoked, then the ejbLoad is invoked when I get the first field. After that my client program receives a Server Exception: RemoteException occured in server thread; Nested exception is java.lang.IllegalStateException: Removing bean lock and it has TX Set!
Unfortunately I don't have the server stack trace, as the server does not display a stack trace for this exception, even with the DEBUG threshold set. For what it's worth, I've attached the client code that generates the exception. The error line is marked with a *.
public void testBeanManagedPersistence() {
   System.out.println();
   System.out.println("This tester verifies that BMP is working properly.");
   System.out.println("Creating Harriet Hightower.");
   AccountHolderBMPRemote harriet = null;
     try{
       Object obj = ctx.lookup("atm/bmp/ejb/accountHolderEJB");
       AccountHolderBMPRemoteHome bmpHome = (AccountHolderBMPRemoteHome)
         PortableRemoteObject.narrow(obj, AccountHolderBMPRemoteHome.class);
       try{
         harriet = bmpHome.findByIdentity("hhightower", "123");
         System.out.println("Harriet Hightower is found.");
       }
       catch(FinderException e){
         harriet = bmpHome.create("Harriet", "Hightower", "your.name@your.domain", "hhightower", "123");
         System.out.println("Harriet Hightower is created.");
       }
*      System.out.println( harriet.getFirstName() + " " + harriet.getLastName() + " " + harriet.getEmailAddress());
       System.out.println("Harriet's Primary key is " + harriet.getPrimaryKey().toString());
       harriet.remove();
       System.out.println("Harriet has been removed.");
     }
     catch(Exception e){
       e.printStackTrace();
     }
}
This code blows when attempting to invoke harriet.getFirstName(). I can't see that there's a problem with this source. Hopefully someone can offer some insight into what might cause that transaction problem. Thanks,
Mac