User: sylvain
Date: 00/06/12 15:38:27
Modified: src/java/org/jboss/zol/testbean/bean
EnterpriseEntityBean.java
Log:
Added a new test :
there's a method in the EntityCMP which creates another entity.
There used to be a bug in jBoss 1 because of transaction propagation, especially in
the case where a bean cretaed another one....
Revision Changes Path
1.2 +19 -0
zola/src/java/org/jboss/zol/testbean/bean/EnterpriseEntityBean.java
Index: EnterpriseEntityBean.java
===================================================================
RCS file:
/products/cvs/ejboss/zola/src/java/org/jboss/zol/testbean/bean/EnterpriseEntityBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EnterpriseEntityBean.java 2000/04/27 19:45:39 1.1
+++ EnterpriseEntityBean.java 2000/06/12 22:38:26 1.2
@@ -11,6 +11,9 @@
import java.rmi.*;
import javax.ejb.*;
+import org.jboss.zol.testbean.interfaces.EnterpriseEntityHome;
+import org.jboss.zol.testbean.interfaces.EnterpriseEntity;
+
public class EnterpriseEntityBean implements EntityBean {
private EntityContext entityContext;
public String name;
@@ -62,7 +65,23 @@
return "EntityBean.callBusinessMethodA() called, my primaryKey is "+
entityContext.getPrimaryKey().toString();
}
+
+ public EnterpriseEntity createEntity(String newName) throws RemoteException {
+ System.out.println("EntityBean.createEntity() called");
+ EnterpriseEntity newBean;
+ try{
+ EnterpriseEntityHome home =
(EnterpriseEntityHome)entityContext.getEJBObject().getEJBHome();
+ newBean = (EnterpriseEntity)home.create(newName);
+ }catch(Exception e)
+ {
+ throw new RemoteException(e.getMessage());
+ }
+
+
+ return newBean;
+ }
+
public void setEntityContext(EntityContext context) throws RemoteException {
System.out.println("EntityBean.setSessionContext() called");
entityContext = context;