RE: [JBoss-user] CMP 2.0 - CMR fields are NULL

2002-04-22 Thread Mike Dougherty

Daniel,

The code in the ejbPostCreate's look fine. However

On Sat, 2002-04-20 at 12:57, Daniel Santos wrote:
> 
> Did not declare the cmr fields in the ejb-jar.xml file, nor the jboss.xml
> file.
> 

First, start by doing this. At a very minimum you need to have the
relationships described in the ejb-jar.xml. From there JBoss can do a
pretty good job of guessing and managing the relationships.


___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user



RE: [JBoss-user] CMP 2.0 - CMR fields are NULL

2002-04-22 Thread Robertson, Jason

One issue I can see is that you should be returning null in your ejbCreate
methods, although I doubt that's causing the cmr update problem. 

You say you didn't declare the CMR fields in your ejb-jar.xml? If you didn't
declare them, then how will the container know about them? Not sure what you
meant by that comment. 

Jason

-Original Message-
From: Daniel Santos [mailto:[EMAIL PROTECTED]]
Sent: Saturday, April 20, 2002 3:58 PM
To: Mike Dougherty
Cc: [EMAIL PROTECTED]
Subject: RE: [JBoss-user] CMP 2.0 - CMR fields are NULL


Mike,

below is the top of FactoryBean.java. the first EJB created in the chain.


---
import javax.ejb.*;

import org.ejbutils.uid.*;
import org.ejbutils.context.*;

public abstract class FactoryBean implements EntityBean {

  EntityContext entityContext;

  public java.lang.String ejbCreate(java.lang.String name) throws
CreateException {
setName(name);
String objectId;
try {
  objectId = UIDDispenser.getDispenser().getNextId();
} catch (UIDDispenserException e) {
  throw new EJBException(e.toString());
}
this.setId(objectId);
return objectId;
  }

  public void ejbPostCreate(java.lang.String name) throws CreateException {
  }
...
---


and here is the start of ProcessBean.java the second created. It has a cmr
field pointing
to the primary key of factory.


---


import java.util.*;
import javax.rmi.*;
import javax.ejb.*;
import javax.naming.*;

import org.ejbutils.uid.*;
import org.ejbutils.context.*;

public abstract class ProcessBean implements EntityBean {

  EntityContext entityContext;

  public String ejbCreate(String factory, String name) throws
CreateException {

setName(name);
String objectId;
try {
  objectId = UIDDispenser.getDispenser().getNextId();
} catch (UIDDispenserException e) {
  throw new EJBException(e.toString());
}
setId(objectId);

return objectId;
  }

  public void ejbPostCreate(String factory, String name) throws
CreateException {
try {
  Context ctx = new InitialContext();
  FactoryLocalHome flhome =
(FactoryLocalHome)ctx.lookup("java:comp/env/ejb/Factory");
  FactoryLocal fl = flhome.findByName(factory);
  this.setFactory(fl);
} catch (NamingException e) {
  throw new EJBException(e.toString());
} catch (FinderException e) {
  throw new CreateException(e.toString());
}
  }
...
---


Did not declare the cmr fields in the ejb-jar.xml file, nor the jboss.xml
file.

All the ejb creates use the UIDispenser from Emmanuel Sciara (many thanks,
and everyone that contibuted to the solution). The process bean sets the cmr
field pointing to its factory that is looked up by name, in the
ejbPostCreate method.

Many thanks
Daniel




-Original Message-
From: Mike Dougherty [mailto:[EMAIL PROTECTED]]
Sent: sexta-feira, 19 de Abril de 2002 21:28
To: Daniel Santos
Cc: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] CMP 2.0 - CMR fields are NULL


Daniel,

I'm not sure I completely understand the situation. Maybe if you sent
some Java code snippets I could take a stab at it. Like just the
"ejbCreate" and "ejbPostCreate" methods for "Variable" or "Factory"
which ever one is calling the setter method.

/mike


On Fri, 2002-04-19 at 08:54, Daniel Santos wrote:
> hello all !
>
> I'm deploying a hierarchy of entity beans with relations :
>
> FACTORY <- PROCESS <- COMPONENT <- VARIABLE
>
> I call creates from a servlet to create the hierarquy from FACTORY to
> VARIABLE.
>
> The CMR fields are set in each ejbPostCreate methods.
>
> PROCESS sets FACTORY, COMPONENT sets process, so on... up to VARIABLE
>
> after calling the servlet I notice that the CMR fields in the db are NULL.
>
> below is the SQL generated. Where are the UPDATES to set the CMR fields ?
>
> environment :
> Jboss-3.0.0beta
> jdk 1.3.1
> w2k
> mysql-max 3.23.49 with ISAM tables. I know they are not transactional. I
> just need the SELECT FOR UPDATE syntax to work
> jdbc driver : mm.mysql-2.0.8-bin.jar
>
> Many thanks.
> Daniel Santos
>
> --
--
> -
>
> 020419 16:36:18 2 Connect root@localhost on
> 2 Init DB history
> 2 Query   SHOW VARIABLES
> 2 Query   SET autocommit=0
> 2 Query   show tables  FROM history like 'FACTORY'
> 2 Query   rollback
> 020419 16:36:19 2 Query   CREATE TABLE FACTORY (id
VARCHAR(255)
> BINARY NOT NULL, name VARCHAR(255) BINARY, CONSTRAINT pk_FACTORY PRIMARY
K

RE: [JBoss-user] CMP 2.0 - CMR fields are NULL

2002-04-21 Thread Daniel Santos

Oliver,

The setting of the cmr fields in the ejb create methods is against the ejb
spec. I know it by experience. It was my first aproach. JBoss itself told me
that.

Thanks for your interest
Daniel

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 22 de Abril de 2002 0:29
To: Daniel Santos
Cc: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] CMP 2.0 - CMR fields are NULL


Hello Daniel,

I think the reason for your problem is the use of ejbPostCreate to set
the CRM fields. When using CMP the record in the database is created
after the call of ejbCreate but before the call of ejbPostCreate.
Therefore your changes to the CMR fields are not persistent, and that's
why the corresponding SQL statements are missing in the trace.

Oliver


Daniel Santos wrote:

>hello all !
>
>I'm deploying a hierarchy of entity beans with relations :
>
>FACTORY <- PROCESS <- COMPONENT <- VARIABLE
>
>I call creates from a servlet to create the hierarquy from FACTORY to
>VARIABLE.
>
>The CMR fields are set in each ejbPostCreate methods.
>
>PROCESS sets FACTORY, COMPONENT sets process, so on... up to VARIABLE
>
>after calling the servlet I notice that the CMR fields in the db are NULL.
>
>below is the SQL generated. Where are the UPDATES to set the CMR fields ?
>
>environment :
>Jboss-3.0.0beta
>jdk 1.3.1
>w2k
>mysql-max 3.23.49 with ISAM tables. I know they are not transactional. I
>just need the SELECT FOR UPDATE syntax to work
>jdbc driver : mm.mysql-2.0.8-bin.jar
>
>Many thanks.
>Daniel Santos
>
>---
-
>-
>
>020419 16:36:18  2 Connect root@localhost on
> 2 Init DB history
> 2 Query   SHOW VARIABLES
> 2 Query   SET autocommit=0
> 2 Query   show tables  FROM history like 'FACTORY'
> 2 Query   rollback
>020419 16:36:19  2 Query   CREATE TABLE FACTORY (id VARCHAR(255)
>BINARY NOT NULL, name VARCHAR(255) BINARY, CONSTRAINT pk_FACTORY PRIMARY
KEY
>(id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:36:21  2 Query   show tables  FROM history like 'EVENT'
> 2 Query   rollback
> 2 Query   CREATE TABLE EVENT (id VARCHAR(255) BINARY NOT 
>NULL,
>CONSTRAINT pk_EVENT PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:36:22  2 Query   show tables  FROM history like
>'COMPONENT'
> 2 Query   rollback
> 2 Query   CREATE TABLE COMPONENT (id VARCHAR(255) BINARY NOT
>NULL, name VARCHAR(255) BINARY, process VARCHAR(255) BINARY, CONSTRAINT
>pk_COMPONENT PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:36:24  2 Query   show tables  FROM history like
>'VARIABLE'
> 2 Query   rollback
> 2 Query   CREATE TABLE VARIABLE (id VARCHAR(255) BINARY NOT
>NULL, name VARCHAR(255) BINARY, component VARCHAR(255) BINARY, CONSTRAINT
>pk_VARIABLE PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:36:26  2 Query   show tables  FROM history like 'SAMPLE'
> 2 Query   rollback
> 2 Query   CREATE TABLE SAMPLE (id VARCHAR(255) BINARY NOT 
>NULL,
>value VARCHAR(255) BINARY, variable VARCHAR(255) BINARY, CONSTRAINT
>pk_SAMPLE PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
> 2 Query   show tables  FROM history like 'PROCESS'
> 2 Query   rollback
> 2 Query   CREATE TABLE PROCESS (id VARCHAR(255) BINARY NOT
NULL,
>name VARCHAR(255) BINARY, factory VARCHAR(255) BINARY, CONSTRAINT
pk_PROCESS
>PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:37:18  2 Query   SET autocommit=0
> 2 Query   SELECT VALUE FROM HIGH_KEY WHERE NAME = 
>'gruposumol'
>FOR UPDATE
> 2 Query   INSERT INTO HIGH_KEY (VALUE, NAME) VALUES
>('8080808080808080808080808080','gruposumol')
> 2 Query   UPDATE HIGH_KEY SET VALUE =
>'8180808080808080808080808080' WHERE NAM

Re: [JBoss-user] CMP 2.0 - CMR fields are NULL

2002-04-21 Thread Oliver Rossmueller

Hello Daniel,

I think the reason for your problem is the use of ejbPostCreate to set 
the CRM fields. When using CMP the record in the database is created 
after the call of ejbCreate but before the call of ejbPostCreate. 
Therefore your changes to the CMR fields are not persistent, and that's 
why the corresponding SQL statements are missing in the trace.

Oliver


Daniel Santos wrote:

>hello all !
>
>I'm deploying a hierarchy of entity beans with relations :
>
>FACTORY <- PROCESS <- COMPONENT <- VARIABLE
>
>I call creates from a servlet to create the hierarquy from FACTORY to
>VARIABLE.
>
>The CMR fields are set in each ejbPostCreate methods.
>
>PROCESS sets FACTORY, COMPONENT sets process, so on... up to VARIABLE
>
>after calling the servlet I notice that the CMR fields in the db are NULL.
>
>below is the SQL generated. Where are the UPDATES to set the CMR fields ?
>
>environment :
>Jboss-3.0.0beta
>jdk 1.3.1
>w2k
>mysql-max 3.23.49 with ISAM tables. I know they are not transactional. I
>just need the SELECT FOR UPDATE syntax to work
>jdbc driver : mm.mysql-2.0.8-bin.jar
>
>Many thanks.
>Daniel Santos
>
>
>-
>
>020419 16:36:18  2 Connect root@localhost on
> 2 Init DB history
> 2 Query   SHOW VARIABLES
> 2 Query   SET autocommit=0
> 2 Query   show tables  FROM history like 'FACTORY'
> 2 Query   rollback
>020419 16:36:19  2 Query   CREATE TABLE FACTORY (id VARCHAR(255)
>BINARY NOT NULL, name VARCHAR(255) BINARY, CONSTRAINT pk_FACTORY PRIMARY KEY
>(id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:36:21  2 Query   show tables  FROM history like 'EVENT'
> 2 Query   rollback
> 2 Query   CREATE TABLE EVENT (id VARCHAR(255) BINARY NOT 
>NULL,
>CONSTRAINT pk_EVENT PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:36:22  2 Query   show tables  FROM history like
>'COMPONENT'
> 2 Query   rollback
> 2 Query   CREATE TABLE COMPONENT (id VARCHAR(255) BINARY NOT
>NULL, name VARCHAR(255) BINARY, process VARCHAR(255) BINARY, CONSTRAINT
>pk_COMPONENT PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:36:24  2 Query   show tables  FROM history like
>'VARIABLE'
> 2 Query   rollback
> 2 Query   CREATE TABLE VARIABLE (id VARCHAR(255) BINARY NOT
>NULL, name VARCHAR(255) BINARY, component VARCHAR(255) BINARY, CONSTRAINT
>pk_VARIABLE PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:36:26  2 Query   show tables  FROM history like 'SAMPLE'
> 2 Query   rollback
> 2 Query   CREATE TABLE SAMPLE (id VARCHAR(255) BINARY NOT 
>NULL,
>value VARCHAR(255) BINARY, variable VARCHAR(255) BINARY, CONSTRAINT
>pk_SAMPLE PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
> 2 Query   show tables  FROM history like 'PROCESS'
> 2 Query   rollback
> 2 Query   CREATE TABLE PROCESS (id VARCHAR(255) BINARY NOT 
>NULL,
>name VARCHAR(255) BINARY, factory VARCHAR(255) BINARY, CONSTRAINT pk_PROCESS
>PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
>020419 16:37:18  2 Query   SET autocommit=0
> 2 Query   SELECT VALUE FROM HIGH_KEY WHERE NAME = 
>'gruposumol'
>FOR UPDATE
> 2 Query   INSERT INTO HIGH_KEY (VALUE, NAME) VALUES
>('8080808080808080808080808080','gruposumol')
> 2 Query   UPDATE HIGH_KEY SET VALUE =
>'8180808080808080808080808080' WHERE NAME = 'gruposumol'
> 2 Query   SET autocommit=0
> 2 Query   rollback
>020419 16:37:20  2 Quit
> 3 Connect root@localhost on
> 3 Init DB history
> 3 Query   SHOW VARIABLES
> 3 Query   SET autocommit=0
> 3 Query   SELECT COUNT(*) FROM FACTORY WHERE
>id='80808080808080808080808080808080gruposumol'
> 3 Query   INSERT INTO FACTORY (id, name) VALUES
>('80808080808080808080808080808080gruposumol', 'factory')
>020419 16:37:21  3 Query   commit
> 3 Query   rollback
> 3 Query   SELECT COUNT(*) FROM PROCESS WHERE
>id='8080808080808080808080808080818

RE: [JBoss-user] CMP 2.0 - CMR fields are NULL

2002-04-20 Thread Daniel Santos

Mike,

below is the top of FactoryBean.java. the first EJB created in the chain.


---
import javax.ejb.*;

import org.ejbutils.uid.*;
import org.ejbutils.context.*;

public abstract class FactoryBean implements EntityBean {

  EntityContext entityContext;

  public java.lang.String ejbCreate(java.lang.String name) throws
CreateException {
setName(name);
String objectId;
try {
  objectId = UIDDispenser.getDispenser().getNextId();
} catch (UIDDispenserException e) {
  throw new EJBException(e.toString());
}
this.setId(objectId);
return objectId;
  }

  public void ejbPostCreate(java.lang.String name) throws CreateException {
  }
...
---


and here is the start of ProcessBean.java the second created. It has a cmr
field pointing
to the primary key of factory.


---


import java.util.*;
import javax.rmi.*;
import javax.ejb.*;
import javax.naming.*;

import org.ejbutils.uid.*;
import org.ejbutils.context.*;

public abstract class ProcessBean implements EntityBean {

  EntityContext entityContext;

  public String ejbCreate(String factory, String name) throws
CreateException {

setName(name);
String objectId;
try {
  objectId = UIDDispenser.getDispenser().getNextId();
} catch (UIDDispenserException e) {
  throw new EJBException(e.toString());
}
setId(objectId);

return objectId;
  }

  public void ejbPostCreate(String factory, String name) throws
CreateException {
try {
  Context ctx = new InitialContext();
  FactoryLocalHome flhome =
(FactoryLocalHome)ctx.lookup("java:comp/env/ejb/Factory");
  FactoryLocal fl = flhome.findByName(factory);
  this.setFactory(fl);
} catch (NamingException e) {
  throw new EJBException(e.toString());
} catch (FinderException e) {
  throw new CreateException(e.toString());
}
  }
...
---


Did not declare the cmr fields in the ejb-jar.xml file, nor the jboss.xml
file.

All the ejb creates use the UIDispenser from Emmanuel Sciara (many thanks,
and everyone that contibuted to the solution). The process bean sets the cmr
field pointing to its factory that is looked up by name, in the
ejbPostCreate method.

Many thanks
Daniel




-Original Message-
From: Mike Dougherty [mailto:[EMAIL PROTECTED]]
Sent: sexta-feira, 19 de Abril de 2002 21:28
To: Daniel Santos
Cc: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] CMP 2.0 - CMR fields are NULL


Daniel,

I'm not sure I completely understand the situation. Maybe if you sent
some Java code snippets I could take a stab at it. Like just the
"ejbCreate" and "ejbPostCreate" methods for "Variable" or "Factory"
which ever one is calling the setter method.

/mike


On Fri, 2002-04-19 at 08:54, Daniel Santos wrote:
> hello all !
>
> I'm deploying a hierarchy of entity beans with relations :
>
> FACTORY <- PROCESS <- COMPONENT <- VARIABLE
>
> I call creates from a servlet to create the hierarquy from FACTORY to
> VARIABLE.
>
> The CMR fields are set in each ejbPostCreate methods.
>
> PROCESS sets FACTORY, COMPONENT sets process, so on... up to VARIABLE
>
> after calling the servlet I notice that the CMR fields in the db are NULL.
>
> below is the SQL generated. Where are the UPDATES to set the CMR fields ?
>
> environment :
> Jboss-3.0.0beta
> jdk 1.3.1
> w2k
> mysql-max 3.23.49 with ISAM tables. I know they are not transactional. I
> just need the SELECT FOR UPDATE syntax to work
> jdbc driver : mm.mysql-2.0.8-bin.jar
>
> Many thanks.
> Daniel Santos
>
> --
--
> -
>
> 020419 16:36:18 2 Connect root@localhost on
> 2 Init DB history
> 2 Query   SHOW VARIABLES
> 2 Query   SET autocommit=0
> 2 Query   show tables  FROM history like 'FACTORY'
> 2 Query   rollback
> 020419 16:36:19 2 Query   CREATE TABLE FACTORY (id VARCHAR(255)
> BINARY NOT NULL, name VARCHAR(255) BINARY, CONSTRAINT pk_FACTORY PRIMARY
KEY
> (id))
> 2 Query   commit
> 2 Query   rollback
> 020419 16:36:21 2 Query   show tables  FROM history like 'EVENT'
> 2 Query   rollback
> 2 Query   CREATE TABLE EVENT (id VARCHAR(255) BINARY NOT 
>NULL,
> CONSTRAINT pk_EVENT PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
> 020419 16:36:22 2 Query   show tables  FROM history 

Re: [JBoss-user] CMP 2.0 - CMR fields are NULL

2002-04-19 Thread Dain Sundstrom

Daniel,

First upgrade to JBoss 3.0rc1. Then if the problem doesn't go away, you 
will to have to file a simple bug report with a test case at sourceforge.

-dain

Mike Dougherty wrote:

> Daniel,
> 
> I'm not sure I completely understand the situation. Maybe if you sent
> some Java code snippets I could take a stab at it. Like just the
> "ejbCreate" and "ejbPostCreate" methods for "Variable" or "Factory"
> which ever one is calling the setter method.
> 
> /mike
> 
> 
> On Fri, 2002-04-19 at 08:54, Daniel Santos wrote:
> 
>>hello all !
>>
>>I'm deploying a hierarchy of entity beans with relations :
>>
>>FACTORY <- PROCESS <- COMPONENT <- VARIABLE
>>
>>I call creates from a servlet to create the hierarquy from FACTORY to
>>VARIABLE.
>>
>>The CMR fields are set in each ejbPostCreate methods.
>>
>>PROCESS sets FACTORY, COMPONENT sets process, so on... up to VARIABLE
>>
>>after calling the servlet I notice that the CMR fields in the db are NULL.
>>
>>below is the SQL generated. Where are the UPDATES to set the CMR fields ?
>>
>>environment :
>>Jboss-3.0.0beta
>>jdk 1.3.1
>>w2k
>>mysql-max 3.23.49 with ISAM tables. I know they are not transactional. I
>>just need the SELECT FOR UPDATE syntax to work
>>jdbc driver : mm.mysql-2.0.8-bin.jar
>>
>>Many thanks.
>>Daniel Santos
>>
>>
>>-
>>
>>020419 16:36:18 2 Connect root@localhost on
>>2 Init DB history
>>2 Query   SHOW VARIABLES
>>2 Query   SET autocommit=0
>>2 Query   show tables  FROM history like 'FACTORY'
>>2 Query   rollback
>>020419 16:36:19 2 Query   CREATE TABLE FACTORY (id VARCHAR(255)
>>BINARY NOT NULL, name VARCHAR(255) BINARY, CONSTRAINT pk_FACTORY PRIMARY KEY
>>(id))
>>2 Query   commit
>>2 Query   rollback
>>020419 16:36:21 2 Query   show tables  FROM history like 'EVENT'
>>2 Query   rollback
>>2 Query   CREATE TABLE EVENT (id VARCHAR(255) BINARY NOT 
>NULL,
>>CONSTRAINT pk_EVENT PRIMARY KEY (id))
>>2 Query   commit
>>2 Query   rollback
>>020419 16:36:22 2 Query   show tables  FROM history like
>>'COMPONENT'
>>2 Query   rollback
>>2 Query   CREATE TABLE COMPONENT (id VARCHAR(255) BINARY NOT
>>NULL, name VARCHAR(255) BINARY, process VARCHAR(255) BINARY, CONSTRAINT
>>pk_COMPONENT PRIMARY KEY (id))
>>2 Query   commit
>>2 Query   rollback
>>020419 16:36:24 2 Query   show tables  FROM history like
>>'VARIABLE'
>>2 Query   rollback
>>2 Query   CREATE TABLE VARIABLE (id VARCHAR(255) BINARY NOT
>>NULL, name VARCHAR(255) BINARY, component VARCHAR(255) BINARY, CONSTRAINT
>>pk_VARIABLE PRIMARY KEY (id))
>>2 Query   commit
>>2 Query   rollback
>>020419 16:36:26 2 Query   show tables  FROM history like 'SAMPLE'
>>2 Query   rollback
>>2 Query   CREATE TABLE SAMPLE (id VARCHAR(255) BINARY NOT 
>NULL,
>>value VARCHAR(255) BINARY, variable VARCHAR(255) BINARY, CONSTRAINT
>>pk_SAMPLE PRIMARY KEY (id))
>>2 Query   commit
>>2 Query   rollback
>>2 Query   show tables  FROM history like 'PROCESS'
>>2 Query   rollback
>>2 Query   CREATE TABLE PROCESS (id VARCHAR(255) BINARY NOT 
>NULL,
>>name VARCHAR(255) BINARY, factory VARCHAR(255) BINARY, CONSTRAINT pk_PROCESS
>>PRIMARY KEY (id))
>>2 Query   commit
>>2 Query   rollback
>>020419 16:37:18 2 Query   SET autocommit=0
>>2 Query   SELECT VALUE FROM HIGH_KEY WHERE NAME = 
>'gruposumol'
>>FOR UPDATE
>>2 Query   INSERT INTO HIGH_KEY (VALUE, NAME) VALUES
>>('8080808080808080808080808080','gruposumol')
>>2 Query   UPDATE HIGH_KEY SET VALUE =
>>'8180808080808080808080808080' WHERE NAME = 'gruposumol'
>>2 Query   SET autocommit=0
>>2 Query   rollback
>>020419 16:37:20 2 Quit
>>3 Connect root@localhost on
>>3 Init DB history
>>3 Query   SHOW VARIABLES
>>3 Query   SET autocommit=0
>>3 Query   SELECT COUNT(*) FROM FACTORY WHERE
>>id='80808080808080808080808080808080gruposumol'
>>3 Query   INSERT INTO FACTORY (id, name) VALUES
>>('80808080808080808080808080808080gruposumol', 'factory')
>>020419 16:37:21 

Re: [JBoss-user] CMP 2.0 - CMR fields are NULL

2002-04-19 Thread Mike Dougherty

Daniel,

I'm not sure I completely understand the situation. Maybe if you sent
some Java code snippets I could take a stab at it. Like just the
"ejbCreate" and "ejbPostCreate" methods for "Variable" or "Factory"
which ever one is calling the setter method.

/mike


On Fri, 2002-04-19 at 08:54, Daniel Santos wrote:
> hello all !
> 
> I'm deploying a hierarchy of entity beans with relations :
> 
> FACTORY <- PROCESS <- COMPONENT <- VARIABLE
> 
> I call creates from a servlet to create the hierarquy from FACTORY to
> VARIABLE.
> 
> The CMR fields are set in each ejbPostCreate methods.
> 
> PROCESS sets FACTORY, COMPONENT sets process, so on... up to VARIABLE
> 
> after calling the servlet I notice that the CMR fields in the db are NULL.
> 
> below is the SQL generated. Where are the UPDATES to set the CMR fields ?
> 
> environment :
> Jboss-3.0.0beta
> jdk 1.3.1
> w2k
> mysql-max 3.23.49 with ISAM tables. I know they are not transactional. I
> just need the SELECT FOR UPDATE syntax to work
> jdbc driver : mm.mysql-2.0.8-bin.jar
> 
> Many thanks.
> Daniel Santos
> 
> 
> -
> 
> 020419 16:36:18 2 Connect root@localhost on
> 2 Init DB history
> 2 Query   SHOW VARIABLES
> 2 Query   SET autocommit=0
> 2 Query   show tables  FROM history like 'FACTORY'
> 2 Query   rollback
> 020419 16:36:19 2 Query   CREATE TABLE FACTORY (id VARCHAR(255)
> BINARY NOT NULL, name VARCHAR(255) BINARY, CONSTRAINT pk_FACTORY PRIMARY KEY
> (id))
> 2 Query   commit
> 2 Query   rollback
> 020419 16:36:21 2 Query   show tables  FROM history like 'EVENT'
> 2 Query   rollback
> 2 Query   CREATE TABLE EVENT (id VARCHAR(255) BINARY NOT 
>NULL,
> CONSTRAINT pk_EVENT PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
> 020419 16:36:22 2 Query   show tables  FROM history like
> 'COMPONENT'
> 2 Query   rollback
> 2 Query   CREATE TABLE COMPONENT (id VARCHAR(255) BINARY NOT
> NULL, name VARCHAR(255) BINARY, process VARCHAR(255) BINARY, CONSTRAINT
> pk_COMPONENT PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
> 020419 16:36:24 2 Query   show tables  FROM history like
> 'VARIABLE'
> 2 Query   rollback
> 2 Query   CREATE TABLE VARIABLE (id VARCHAR(255) BINARY NOT
> NULL, name VARCHAR(255) BINARY, component VARCHAR(255) BINARY, CONSTRAINT
> pk_VARIABLE PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
> 020419 16:36:26 2 Query   show tables  FROM history like 'SAMPLE'
> 2 Query   rollback
> 2 Query   CREATE TABLE SAMPLE (id VARCHAR(255) BINARY NOT 
>NULL,
> value VARCHAR(255) BINARY, variable VARCHAR(255) BINARY, CONSTRAINT
> pk_SAMPLE PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
> 2 Query   show tables  FROM history like 'PROCESS'
> 2 Query   rollback
> 2 Query   CREATE TABLE PROCESS (id VARCHAR(255) BINARY NOT 
>NULL,
> name VARCHAR(255) BINARY, factory VARCHAR(255) BINARY, CONSTRAINT pk_PROCESS
> PRIMARY KEY (id))
> 2 Query   commit
> 2 Query   rollback
> 020419 16:37:18 2 Query   SET autocommit=0
> 2 Query   SELECT VALUE FROM HIGH_KEY WHERE NAME = 
>'gruposumol'
> FOR UPDATE
> 2 Query   INSERT INTO HIGH_KEY (VALUE, NAME) VALUES
> ('8080808080808080808080808080','gruposumol')
> 2 Query   UPDATE HIGH_KEY SET VALUE =
> '8180808080808080808080808080' WHERE NAME = 'gruposumol'
> 2 Query   SET autocommit=0
> 2 Query   rollback
> 020419 16:37:20 2 Quit
> 3 Connect root@localhost on
> 3 Init DB history
> 3 Query   SHOW VARIABLES
> 3 Query   SET autocommit=0
> 3 Query   SELECT COUNT(*) FROM FACTORY WHERE
> id='80808080808080808080808080808080gruposumol'
> 3 Query   INSERT INTO FACTORY (id, name) VALUES
> ('80808080808080808080808080808080gruposumol', 'factory')
> 020419 16:37:21 3 Query   commit
> 3 Query   rollback
> 3 Query   SELECT COUNT(*) FROM PROCESS WHERE
> id='80808080808080808080808080808180gruposumol'
>

[JBoss-user] CMP 2.0 - CMR fields are NULL

2002-04-19 Thread Daniel Santos

hello all !

I'm deploying a hierarchy of entity beans with relations :

FACTORY <- PROCESS <- COMPONENT <- VARIABLE

I call creates from a servlet to create the hierarquy from FACTORY to
VARIABLE.

The CMR fields are set in each ejbPostCreate methods.

PROCESS sets FACTORY, COMPONENT sets process, so on... up to VARIABLE

after calling the servlet I notice that the CMR fields in the db are NULL.

below is the SQL generated. Where are the UPDATES to set the CMR fields ?

environment :
Jboss-3.0.0beta
jdk 1.3.1
w2k
mysql-max 3.23.49 with ISAM tables. I know they are not transactional. I
just need the SELECT FOR UPDATE syntax to work
jdbc driver : mm.mysql-2.0.8-bin.jar

Many thanks.
Daniel Santos


-

020419 16:36:18   2 Connect root@localhost on
  2 Init DB history
  2 Query   SHOW VARIABLES
  2 Query   SET autocommit=0
  2 Query   show tables  FROM history like 'FACTORY'
  2 Query   rollback
020419 16:36:19   2 Query   CREATE TABLE FACTORY (id VARCHAR(255)
BINARY NOT NULL, name VARCHAR(255) BINARY, CONSTRAINT pk_FACTORY PRIMARY KEY
(id))
  2 Query   commit
  2 Query   rollback
020419 16:36:21   2 Query   show tables  FROM history like 'EVENT'
  2 Query   rollback
  2 Query   CREATE TABLE EVENT (id VARCHAR(255) BINARY NOT 
NULL,
CONSTRAINT pk_EVENT PRIMARY KEY (id))
  2 Query   commit
  2 Query   rollback
020419 16:36:22   2 Query   show tables  FROM history like
'COMPONENT'
  2 Query   rollback
  2 Query   CREATE TABLE COMPONENT (id VARCHAR(255) BINARY NOT
NULL, name VARCHAR(255) BINARY, process VARCHAR(255) BINARY, CONSTRAINT
pk_COMPONENT PRIMARY KEY (id))
  2 Query   commit
  2 Query   rollback
020419 16:36:24   2 Query   show tables  FROM history like
'VARIABLE'
  2 Query   rollback
  2 Query   CREATE TABLE VARIABLE (id VARCHAR(255) BINARY NOT
NULL, name VARCHAR(255) BINARY, component VARCHAR(255) BINARY, CONSTRAINT
pk_VARIABLE PRIMARY KEY (id))
  2 Query   commit
  2 Query   rollback
020419 16:36:26   2 Query   show tables  FROM history like 'SAMPLE'
  2 Query   rollback
  2 Query   CREATE TABLE SAMPLE (id VARCHAR(255) BINARY NOT 
NULL,
value VARCHAR(255) BINARY, variable VARCHAR(255) BINARY, CONSTRAINT
pk_SAMPLE PRIMARY KEY (id))
  2 Query   commit
  2 Query   rollback
  2 Query   show tables  FROM history like 'PROCESS'
  2 Query   rollback
  2 Query   CREATE TABLE PROCESS (id VARCHAR(255) BINARY NOT 
NULL,
name VARCHAR(255) BINARY, factory VARCHAR(255) BINARY, CONSTRAINT pk_PROCESS
PRIMARY KEY (id))
  2 Query   commit
  2 Query   rollback
020419 16:37:18   2 Query   SET autocommit=0
  2 Query   SELECT VALUE FROM HIGH_KEY WHERE NAME = 
'gruposumol'
FOR UPDATE
  2 Query   INSERT INTO HIGH_KEY (VALUE, NAME) VALUES
('8080808080808080808080808080','gruposumol')
  2 Query   UPDATE HIGH_KEY SET VALUE =
'8180808080808080808080808080' WHERE NAME = 'gruposumol'
  2 Query   SET autocommit=0
  2 Query   rollback
020419 16:37:20   2 Quit
  3 Connect root@localhost on
  3 Init DB history
  3 Query   SHOW VARIABLES
  3 Query   SET autocommit=0
  3 Query   SELECT COUNT(*) FROM FACTORY WHERE
id='80808080808080808080808080808080gruposumol'
  3 Query   INSERT INTO FACTORY (id, name) VALUES
('80808080808080808080808080808080gruposumol', 'factory')
020419 16:37:21   3 Query   commit
  3 Query   rollback
  3 Query   SELECT COUNT(*) FROM PROCESS WHERE
id='80808080808080808080808080808180gruposumol'
  3 Query   INSERT INTO PROCESS (id, name, factory) VALUES
('80808080808080808080808080808180gruposumol', 'process', null)
  3 Query   SELECT t1_f.id FROM FACTORY t1_f WHERE t1_f.name =
'factory'
  3 Query   SELECT name FROM FACTORY WHERE
(id='80808080808080808080808080808080gruposumol')
  3 Query   SELECT id FROM PROCESS WHERE
(factory='80808080808080808080808080808080gruposumol')
  3