RE: Problem retrieving dependents after Orion restart

2001-03-06 Thread Jeff Schnitzer

IMHO, it is unwise to be using EJB2.0 dependent objects at this point
because this is a part of the spec which is likely to change wildly.
There have even been significant changes between pd1 (when Orion's
implementation was built) and pfd.

You can circumvent the relationship table by creating a unidrectional
relationship from Phone to Person and a finder method for Phone which is
"findByPerson".  If you put a getPhone() method on Person, it can hide
the call to the finder on Phone.

Jeff

-Original Message-
From: Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 05, 2001 10:37 PM
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


Has any one been able to get the Entity(1) to Dependent(N) relationship
working?  I am thinking of removing Dependent objects and just 
using Entity
Beans.  However, in the way Orion handles relationships, I will have an
extra table I do not really need.

If I have a PersonEntity relating to PhoneEntity in a 1-N 
scenario, then
Orion attempts to create PersonEntity-PhoneEntity join table.  
Is there a
way to modify orion-ejb-jar.xml to avoid this type of scenario.  All my
Entities are identified with integer key, so my phone table 
simply contains
a field called 'ownerId'.  Different types of entities can 
have phones, but
since all the entities are identified with the same type of 
primary key, I
can store that in the 'ownerId' field in the phone table.

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 6:13 PM
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


Here is an excerpt from orion-ejb-jar.xml, can someone tell me 
if I have
something configured incorrectly.  Again, the data is properly 
written to
the database, it is just NOT READ when orion is restarted and
getPhoneDependents() api is executed.

entity-deployment name="ejb.person.PersonEntity"
location="ejb.person.PersonEntity"
wrapper="PersonEntityHome_EntityHomeWrapper33"
table="ejb_person_PersonEntity" data-source="jdbc/siteDS"
  primkey-mapping
cmp-field-mapping
  fields
 cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  cmp-field-mapping name="salutation" persistence-name="salutation" /
  cmp-field-mapping name="name" persistence-name="name" /
  cmp-field-mapping name="email" persistence-name="email" /
  cmp-field-mapping name="phoneDependents"
collection-mapping table="ejb_phones"
  primkey-mapping
cmp-field-mapping
  fields
cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  value-mapping type="ejb.person.PersonPhone"
cmp-field-mapping name="value"
  properties
cmp-field-mapping name="id" persistence-name="id" /
cmp-field-mapping name="number" 
persistence-name="number" /
cmp-field-mapping name="person"
  entity-ref home="ejb.person.PersonEntity"
cmp-field-mapping name="person"
  fields
cmp-field-mapping name="id" 
persistence-name="ownerId"
/
  /fields
/cmp-field-mapping
  /entity-ref
/cmp-field-mapping
  /properties
/cmp-field-mapping
  /value-mapping
/collection-mapping
  /cmp-field-mapping
  ejb-ref-mapping name="ejb/id" /
/entity-deployment

Again, the ejb.person.PersonEntity has a 1 to N relation with dependend
ejb.pers.PersonPhone.

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 1:18 PM
To: Orion-Interest
Subject: Problem retrieving dependents after Orion restart


I have an entity bean with 1-N relationships to dependents.  I have two
clients, the first client executes a method on a session that 
populates and
works with the data.  The second client tries to access the 
data.  When I
run the first client followed by the second client, second client works
correctly.  When I run the first client, then RESTART ORION, 
then run second
client, second client fails to find dependents (but they are 
there, in the
table).

Here is the output:

Orion/1.4.7 initialized
Create person entity
Add phone1
Add phone2
Add phone3
Phone: 8551 (818) 541-0029 1
Phone: 8552 None 2
Phone: 8553 (310) 880-5962 3
Deleting last phone
Phones: [Lejb.util.Value;@44006e

[apara@junior orion]$ ./go
Orion/1.4.7 initialized
Phones: null

First we create a new person entity, set the phones 
(dependents), then list
the phones, finally delete the last phone.  Then restarting 
orion, we try to
lookup the phone dependents.  Phones returns as null.  The 
table contains
correct values.  Phones ARE there.

What could be wrong?

-AP_









RE: Problem retrieving dependents after Orion restart

2001-03-06 Thread Dan North

You can also enforce the dependency (cascade delete) by overriding void 
ejbRemove() throws RemoteException in your EJB class to find all dependents 
by your bean and .remove() them.

Cheers,
Dan.

At 00:53 06/03/2001 -0800, you wrote:
IMHO, it is unwise to be using EJB2.0 dependent objects at this point
because this is a part of the spec which is likely to change wildly.
There have even been significant changes between pd1 (when Orion's
implementation was built) and pfd.

You can circumvent the relationship table by creating a unidrectional
relationship from Phone to Person and a finder method for Phone which is
"findByPerson".  If you put a getPhone() method on Person, it can hide
the call to the finder on Phone.

Jeff

 -Original Message-
 From: Alex Paransky [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 05, 2001 10:37 PM
 To: Orion-Interest
 Subject: RE: Problem retrieving dependents after Orion restart
 
 
 Has any one been able to get the Entity(1) to Dependent(N) relationship
 working?  I am thinking of removing Dependent objects and just
 using Entity
 Beans.  However, in the way Orion handles relationships, I will have an
 extra table I do not really need.
 
 If I have a PersonEntity relating to PhoneEntity in a 1-N
 scenario, then
 Orion attempts to create PersonEntity-PhoneEntity join table.
 Is there a
 way to modify orion-ejb-jar.xml to avoid this type of scenario.  All my
 Entities are identified with integer key, so my phone table
 simply contains
 a field called 'ownerId'.  Different types of entities can
 have phones, but
 since all the entities are identified with the same type of
 primary key, I
 can store that in the 'ownerId' field in the phone table.
 
 Thanks.
 -AP_
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
 Sent: Monday, March 05, 2001 6:13 PM
 To: Orion-Interest
 Subject: RE: Problem retrieving dependents after Orion restart
 
 
 Here is an excerpt from orion-ejb-jar.xml, can someone tell me
 if I have
 something configured incorrectly.  Again, the data is properly
 written to
 the database, it is just NOT READ when orion is restarted and
 getPhoneDependents() api is executed.
 
 entity-deployment name="ejb.person.PersonEntity"
 location="ejb.person.PersonEntity"
 wrapper="PersonEntityHome_EntityHomeWrapper33"
 table="ejb_person_PersonEntity" data-source="jdbc/siteDS"
   primkey-mapping
 cmp-field-mapping
   fields
  cmp-field-mapping name="id" persistence-name="id" /
   /fields
 /cmp-field-mapping
   /primkey-mapping
   cmp-field-mapping name="salutation" persistence-name="salutation" /
   cmp-field-mapping name="name" persistence-name="name" /
   cmp-field-mapping name="email" persistence-name="email" /
   cmp-field-mapping name="phoneDependents"
 collection-mapping table="ejb_phones"
   primkey-mapping
 cmp-field-mapping
   fields
 cmp-field-mapping name="id" persistence-name="id" /
   /fields
 /cmp-field-mapping
   /primkey-mapping
   value-mapping type="ejb.person.PersonPhone"
 cmp-field-mapping name="value"
   properties
 cmp-field-mapping name="id" persistence-name="id" /
 cmp-field-mapping name="number"
 persistence-name="number" /
 cmp-field-mapping name="person"
   entity-ref home="ejb.person.PersonEntity"
 cmp-field-mapping name="person"
   fields
 cmp-field-mapping name="id"
 persistence-name="ownerId"
 /
   /fields
 /cmp-field-mapping
   /entity-ref
 /cmp-field-mapping
   /properties
 /cmp-field-mapping
   /value-mapping
 /collection-mapping
   /cmp-field-mapping
   ejb-ref-mapping name="ejb/id" /
 /entity-deployment
 
 Again, the ejb.person.PersonEntity has a 1 to N relation with dependend
 ejb.pers.PersonPhone.
 
 Thanks.
 -AP_
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
 Sent: Monday, March 05, 2001 1:18 PM
 To: Orion-Interest
 Subject: Problem retrieving dependents after Orion restart
 
 
 I have an entity bean with 1-N relationships to dependents.  I have two
 clients, the first client executes a method on a session that
 populates and
 works with the data.  The second client tries to access the
 data.  When I
 run the first client followed by the second client, second client works
 correctly.  When I run the first client, then RESTART ORION,
 then run second
 client, second client fails to find dependents (but they are
 there, in the
 table).
 
 He

RE: Problem retrieving dependents after Orion restart

2001-03-06 Thread Alex Paransky

I can find the EntityBean correctly, it's when the public abstract
Collection getPhoneDependents() is called, that I get a null object from
this call.  If the server is not restarted between the creation of the
Person entity, and adding some phone numbers, the getPhoneDependents()
properly returns the collection.  If the server IS restarted, then null is
returned.  Again, everything appears to be stored correctly in the database
it's self.  All the fields which need to be populated are.

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Randahl Fink
Isaksen
Sent: Monday, March 05, 2001 11:59 PM
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


I had the same symptom once, I had declared my primary keys as Integer and
returned int rather than Integer in my ejbCreate methods. Have you
accidently done the same???
Anyways, it seems Orion is quite non-informative about semantical errors, so
I have entered a bug report about this issue (#349).

R.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: 6. marts 2001 04:59
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


I have been playing with the simple example some more, and still cannot
resolve the issue.  The strange thing is that it seems to write the data to
the tables correctly.  All the fields are filled in as expected, it just
fails to read the data back after restart.  I am not sure the best way to
proceed.

Here are the layout for the tables which are being used:

Person Table:
++---+--+-+-+---+
| Field  | Type  | Null | Key | Default | Extra |
++---+--+-+-+---+
| id | bigint(20)|  | PRI | 0   |   |
| salutation | varchar(255)  | YES  | | NULL|   |
| name   | varchar(255)  | YES  | | NULL|   |
| email  | varchar(255)  | YES  | | NULL|   |
| createDate | timestamp(14) | YES  | | NULL|   |
| modifyDate | timestamp(14) | YES  | | NULL|   |
| parentId   | bigint(20)| YES  | | NULL|   |
| parentRelation | bigint(20)| YES  | | NULL|   |
++---+--+-+-+---+

Phones Table:
+-+--+--+-+-+---+
| Field   | Type | Null | Key | Default | Extra |
+-+--+--+-+-+---+
| id  | bigint(20)   |  | | 0   |   |
| number  | varchar(255) | YES  | | NULL|   |
| ownerId | bigint(20)   | YES  | | NULL|   |
+-+--+--+-+-+---+

In the PhonesTable ownerId is the foreign key for person.id field.  The
following join properly returns the data:

select * from ejb_person_PersonEntity pe, ejb_phones ph where pe.id =
ph.ownerId;

Does any one know what the problem is?

Thanks.
-AP_





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 6:13 PM
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


Here is an excerpt from orion-ejb-jar.xml, can someone tell me if I have
something configured incorrectly.  Again, the data is properly written to
the database, it is just NOT READ when orion is restarted and
getPhoneDependents() api is executed.

entity-deployment name="ejb.person.PersonEntity"
location="ejb.person.PersonEntity"
wrapper="PersonEntityHome_EntityHomeWrapper33"
table="ejb_person_PersonEntity" data-source="jdbc/siteDS"
  primkey-mapping
cmp-field-mapping
  fields
  cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  cmp-field-mapping name="salutation" persistence-name="salutation" /
  cmp-field-mapping name="name" persistence-name="name" /
  cmp-field-mapping name="email" persistence-name="email" /
  cmp-field-mapping name="phoneDependents"
collection-mapping table="ejb_phones"
  primkey-mapping
cmp-field-mapping
  fields
cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  value-mapping type="ejb.person.PersonPhone"
cmp-field-mapping name="value"
  properties
cmp-field-mapping name="id" persistence-name="id" /
cmp-field-mapping name="number" persistence-name="number" /
cmp-field-mapping name="person"
  entity-ref home="ejb.person.Perso

RE: Problem retrieving dependents after Orion restart

2001-03-06 Thread Alex Paransky

So is most of your development using Entity/Session beans?

Are you using EJB20 Entity style beans (using abstract methods?), or are you
still using EJB1.1 style beans.

Are EJB20 queries safe to use with Orion?  Do they work?

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Dan North
Sent: Tuesday, March 06, 2001 8:52 AM
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


You can also enforce the dependency (cascade delete) by overriding void
ejbRemove() throws RemoteException in your EJB class to find all dependents
by your bean and .remove() them.

Cheers,
Dan.

At 00:53 06/03/2001 -0800, you wrote:
IMHO, it is unwise to be using EJB2.0 dependent objects at this point
because this is a part of the spec which is likely to change wildly.
There have even been significant changes between pd1 (when Orion's
implementation was built) and pfd.

You can circumvent the relationship table by creating a unidrectional
relationship from Phone to Person and a finder method for Phone which is
"findByPerson".  If you put a getPhone() method on Person, it can hide
the call to the finder on Phone.

Jeff

 -Original Message-
 From: Alex Paransky [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 05, 2001 10:37 PM
 To: Orion-Interest
 Subject: RE: Problem retrieving dependents after Orion restart
 
 
 Has any one been able to get the Entity(1) to Dependent(N) relationship
 working?  I am thinking of removing Dependent objects and just
 using Entity
 Beans.  However, in the way Orion handles relationships, I will have an
 extra table I do not really need.
 
 If I have a PersonEntity relating to PhoneEntity in a 1-N
 scenario, then
 Orion attempts to create PersonEntity-PhoneEntity join table.
 Is there a
 way to modify orion-ejb-jar.xml to avoid this type of scenario.  All my
 Entities are identified with integer key, so my phone table
 simply contains
 a field called 'ownerId'.  Different types of entities can
 have phones, but
 since all the entities are identified with the same type of
 primary key, I
 can store that in the 'ownerId' field in the phone table.
 
 Thanks.
 -AP_
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
 Sent: Monday, March 05, 2001 6:13 PM
 To: Orion-Interest
 Subject: RE: Problem retrieving dependents after Orion restart
 
 
 Here is an excerpt from orion-ejb-jar.xml, can someone tell me
 if I have
 something configured incorrectly.  Again, the data is properly
 written to
 the database, it is just NOT READ when orion is restarted and
 getPhoneDependents() api is executed.
 
 entity-deployment name="ejb.person.PersonEntity"
 location="ejb.person.PersonEntity"
 wrapper="PersonEntityHome_EntityHomeWrapper33"
 table="ejb_person_PersonEntity" data-source="jdbc/siteDS"
   primkey-mapping
 cmp-field-mapping
   fields
  cmp-field-mapping name="id" persistence-name="id" /
   /fields
 /cmp-field-mapping
   /primkey-mapping
   cmp-field-mapping name="salutation" persistence-name="salutation" /
   cmp-field-mapping name="name" persistence-name="name" /
   cmp-field-mapping name="email" persistence-name="email" /
   cmp-field-mapping name="phoneDependents"
 collection-mapping table="ejb_phones"
   primkey-mapping
 cmp-field-mapping
   fields
 cmp-field-mapping name="id" persistence-name="id" /
   /fields
 /cmp-field-mapping
   /primkey-mapping
   value-mapping type="ejb.person.PersonPhone"
 cmp-field-mapping name="value"
   properties
 cmp-field-mapping name="id" persistence-name="id" /
 cmp-field-mapping name="number"
 persistence-name="number" /
 cmp-field-mapping name="person"
   entity-ref home="ejb.person.PersonEntity"
 cmp-field-mapping name="person"
   fields
 cmp-field-mapping name="id"
 persistence-name="ownerId"
 /
   /fields
 /cmp-field-mapping
   /entity-ref
 /cmp-field-mapping
   /properties
 /cmp-field-mapping
   /value-mapping
 /collection-mapping
   /cmp-field-mapping
   ejb-ref-mapping name="ejb/id" /
 /entity-deployment
 
 Again, the ejb.person.PersonEntity has a 1 to N relation with dependend
 ejb.pers.PersonPhone.
 
 Thanks.
 -AP_
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
 Sent: Monday, March 05, 2001 1:18 PM
 To: Orion-Interest
 Subject: Problem retrieving dependents after Orion restart
 
 
 I have an

RE: Problem retrieving dependents after Orion restart

2001-03-05 Thread Alex Paransky

Here is an excerpt from orion-ejb-jar.xml, can someone tell me if I have
something configured incorrectly.  Again, the data is properly written to
the database, it is just NOT READ when orion is restarted and
getPhoneDependents() api is executed.

entity-deployment name="ejb.person.PersonEntity"
location="ejb.person.PersonEntity"
wrapper="PersonEntityHome_EntityHomeWrapper33"
table="ejb_person_PersonEntity" data-source="jdbc/siteDS"
  primkey-mapping
cmp-field-mapping
  fields
  cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  cmp-field-mapping name="salutation" persistence-name="salutation" /
  cmp-field-mapping name="name" persistence-name="name" /
  cmp-field-mapping name="email" persistence-name="email" /
  cmp-field-mapping name="phoneDependents"
collection-mapping table="ejb_phones"
  primkey-mapping
cmp-field-mapping
  fields
cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  value-mapping type="ejb.person.PersonPhone"
cmp-field-mapping name="value"
  properties
cmp-field-mapping name="id" persistence-name="id" /
cmp-field-mapping name="number" persistence-name="number" /
cmp-field-mapping name="person"
  entity-ref home="ejb.person.PersonEntity"
cmp-field-mapping name="person"
  fields
cmp-field-mapping name="id" persistence-name="ownerId"
/
  /fields
/cmp-field-mapping
  /entity-ref
/cmp-field-mapping
  /properties
/cmp-field-mapping
  /value-mapping
/collection-mapping
  /cmp-field-mapping
  ejb-ref-mapping name="ejb/id" /
/entity-deployment

Again, the ejb.person.PersonEntity has a 1 to N relation with dependend
ejb.pers.PersonPhone.

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 1:18 PM
To: Orion-Interest
Subject: Problem retrieving dependents after Orion restart


I have an entity bean with 1-N relationships to dependents.  I have two
clients, the first client executes a method on a session that populates and
works with the data.  The second client tries to access the data.  When I
run the first client followed by the second client, second client works
correctly.  When I run the first client, then RESTART ORION, then run second
client, second client fails to find dependents (but they are there, in the
table).

Here is the output:

Orion/1.4.7 initialized
Create person entity
Add phone1
Add phone2
Add phone3
Phone: 8551 (818) 541-0029 1
Phone: 8552 None 2
Phone: 8553 (310) 880-5962 3
Deleting last phone
Phones: [Lejb.util.Value;@44006e

[apara@junior orion]$ ./go
Orion/1.4.7 initialized
Phones: null

First we create a new person entity, set the phones (dependents), then list
the phones, finally delete the last phone.  Then restarting orion, we try to
lookup the phone dependents.  Phones returns as null.  The table contains
correct values.  Phones ARE there.

What could be wrong?

-AP_






RE: Problem retrieving dependents after Orion restart

2001-03-05 Thread Alex Paransky

I have been playing with the simple example some more, and still cannot
resolve the issue.  The strange thing is that it seems to write the data to
the tables correctly.  All the fields are filled in as expected, it just
fails to read the data back after restart.  I am not sure the best way to
proceed.

Here are the layout for the tables which are being used:

Person Table:
++---+--+-+-+---+
| Field  | Type  | Null | Key | Default | Extra |
++---+--+-+-+---+
| id | bigint(20)|  | PRI | 0   |   |
| salutation | varchar(255)  | YES  | | NULL|   |
| name   | varchar(255)  | YES  | | NULL|   |
| email  | varchar(255)  | YES  | | NULL|   |
| createDate | timestamp(14) | YES  | | NULL|   |
| modifyDate | timestamp(14) | YES  | | NULL|   |
| parentId   | bigint(20)| YES  | | NULL|   |
| parentRelation | bigint(20)| YES  | | NULL|   |
++---+--+-+-+---+

Phones Table:
+-+--+--+-+-+---+
| Field   | Type | Null | Key | Default | Extra |
+-+--+--+-+-+---+
| id  | bigint(20)   |  | | 0   |   |
| number  | varchar(255) | YES  | | NULL|   |
| ownerId | bigint(20)   | YES  | | NULL|   |
+-+--+--+-+-+---+

In the PhonesTable ownerId is the foreign key for person.id field.  The
following join properly returns the data:

select * from ejb_person_PersonEntity pe, ejb_phones ph where pe.id =
ph.ownerId;

Does any one know what the problem is?

Thanks.
-AP_





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 6:13 PM
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


Here is an excerpt from orion-ejb-jar.xml, can someone tell me if I have
something configured incorrectly.  Again, the data is properly written to
the database, it is just NOT READ when orion is restarted and
getPhoneDependents() api is executed.

entity-deployment name="ejb.person.PersonEntity"
location="ejb.person.PersonEntity"
wrapper="PersonEntityHome_EntityHomeWrapper33"
table="ejb_person_PersonEntity" data-source="jdbc/siteDS"
  primkey-mapping
cmp-field-mapping
  fields
  cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  cmp-field-mapping name="salutation" persistence-name="salutation" /
  cmp-field-mapping name="name" persistence-name="name" /
  cmp-field-mapping name="email" persistence-name="email" /
  cmp-field-mapping name="phoneDependents"
collection-mapping table="ejb_phones"
  primkey-mapping
cmp-field-mapping
  fields
cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  value-mapping type="ejb.person.PersonPhone"
cmp-field-mapping name="value"
  properties
cmp-field-mapping name="id" persistence-name="id" /
cmp-field-mapping name="number" persistence-name="number" /
cmp-field-mapping name="person"
  entity-ref home="ejb.person.PersonEntity"
cmp-field-mapping name="person"
  fields
cmp-field-mapping name="id" persistence-name="ownerId"
/
  /fields
/cmp-field-mapping
  /entity-ref
/cmp-field-mapping
  /properties
/cmp-field-mapping
  /value-mapping
/collection-mapping
  /cmp-field-mapping
  ejb-ref-mapping name="ejb/id" /
/entity-deployment

Again, the ejb.person.PersonEntity has a 1 to N relation with dependend
ejb.pers.PersonPhone.

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 1:18 PM
To: Orion-Interest
Subject: Problem retrieving dependents after Orion restart


I have an entity bean with 1-N relationships to dependents.  I have two
clients, the first client executes a method on a session that populates and
works with the data.  The second client tries to access the data.  When I
run the first client followed by the second client, second client works
correctly.  When I run the first client, then RESTART ORION, then run second
client, second client fails to find dependents (but they are t

RE: Problem retrieving dependents after Orion restart

2001-03-05 Thread Alex Paransky

Has any one been able to get the Entity(1) to Dependent(N) relationship
working?  I am thinking of removing Dependent objects and just using Entity
Beans.  However, in the way Orion handles relationships, I will have an
extra table I do not really need.

If I have a PersonEntity relating to PhoneEntity in a 1-N scenario, then
Orion attempts to create PersonEntity-PhoneEntity join table.  Is there a
way to modify orion-ejb-jar.xml to avoid this type of scenario.  All my
Entities are identified with integer key, so my phone table simply contains
a field called 'ownerId'.  Different types of entities can have phones, but
since all the entities are identified with the same type of primary key, I
can store that in the 'ownerId' field in the phone table.

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 6:13 PM
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


Here is an excerpt from orion-ejb-jar.xml, can someone tell me if I have
something configured incorrectly.  Again, the data is properly written to
the database, it is just NOT READ when orion is restarted and
getPhoneDependents() api is executed.

entity-deployment name="ejb.person.PersonEntity"
location="ejb.person.PersonEntity"
wrapper="PersonEntityHome_EntityHomeWrapper33"
table="ejb_person_PersonEntity" data-source="jdbc/siteDS"
  primkey-mapping
cmp-field-mapping
  fields
  cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  cmp-field-mapping name="salutation" persistence-name="salutation" /
  cmp-field-mapping name="name" persistence-name="name" /
  cmp-field-mapping name="email" persistence-name="email" /
  cmp-field-mapping name="phoneDependents"
collection-mapping table="ejb_phones"
  primkey-mapping
cmp-field-mapping
  fields
cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  value-mapping type="ejb.person.PersonPhone"
cmp-field-mapping name="value"
  properties
cmp-field-mapping name="id" persistence-name="id" /
cmp-field-mapping name="number" persistence-name="number" /
cmp-field-mapping name="person"
  entity-ref home="ejb.person.PersonEntity"
cmp-field-mapping name="person"
  fields
cmp-field-mapping name="id" persistence-name="ownerId"
/
  /fields
/cmp-field-mapping
  /entity-ref
/cmp-field-mapping
  /properties
/cmp-field-mapping
  /value-mapping
/collection-mapping
  /cmp-field-mapping
  ejb-ref-mapping name="ejb/id" /
/entity-deployment

Again, the ejb.person.PersonEntity has a 1 to N relation with dependend
ejb.pers.PersonPhone.

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 1:18 PM
To: Orion-Interest
Subject: Problem retrieving dependents after Orion restart


I have an entity bean with 1-N relationships to dependents.  I have two
clients, the first client executes a method on a session that populates and
works with the data.  The second client tries to access the data.  When I
run the first client followed by the second client, second client works
correctly.  When I run the first client, then RESTART ORION, then run second
client, second client fails to find dependents (but they are there, in the
table).

Here is the output:

Orion/1.4.7 initialized
Create person entity
Add phone1
Add phone2
Add phone3
Phone: 8551 (818) 541-0029 1
Phone: 8552 None 2
Phone: 8553 (310) 880-5962 3
Deleting last phone
Phones: [Lejb.util.Value;@44006e

[apara@junior orion]$ ./go
Orion/1.4.7 initialized
Phones: null

First we create a new person entity, set the phones (dependents), then list
the phones, finally delete the last phone.  Then restarting orion, we try to
lookup the phone dependents.  Phones returns as null.  The table contains
correct values.  Phones ARE there.

What could be wrong?

-AP_







RE: Problem retrieving dependents after Orion restart

2001-03-05 Thread Randahl Fink Isaksen

I had the same symptom once, I had declared my primary keys as Integer and
returned int rather than Integer in my ejbCreate methods. Have you
accidently done the same???
Anyways, it seems Orion is quite non-informative about semantical errors, so
I have entered a bug report about this issue (#349).

R.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: 6. marts 2001 04:59
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


I have been playing with the simple example some more, and still cannot
resolve the issue.  The strange thing is that it seems to write the data to
the tables correctly.  All the fields are filled in as expected, it just
fails to read the data back after restart.  I am not sure the best way to
proceed.

Here are the layout for the tables which are being used:

Person Table:
++---+--+-+-+---+
| Field  | Type  | Null | Key | Default | Extra |
++---+--+-+-+---+
| id | bigint(20)|  | PRI | 0   |   |
| salutation | varchar(255)  | YES  | | NULL|   |
| name   | varchar(255)  | YES  | | NULL|   |
| email  | varchar(255)  | YES  | | NULL|   |
| createDate | timestamp(14) | YES  | | NULL|   |
| modifyDate | timestamp(14) | YES  | | NULL|   |
| parentId   | bigint(20)| YES  | | NULL|   |
| parentRelation | bigint(20)| YES  | | NULL|   |
++---+--+-+-+---+

Phones Table:
+-+--+--+-+-+---+
| Field   | Type | Null | Key | Default | Extra |
+-+--+--+-+-+---+
| id  | bigint(20)   |  | | 0   |   |
| number  | varchar(255) | YES  | | NULL|   |
| ownerId | bigint(20)   | YES  | | NULL|   |
+-+--+--+-+-+---+

In the PhonesTable ownerId is the foreign key for person.id field.  The
following join properly returns the data:

select * from ejb_person_PersonEntity pe, ejb_phones ph where pe.id =
ph.ownerId;

Does any one know what the problem is?

Thanks.
-AP_





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 6:13 PM
To: Orion-Interest
Subject: RE: Problem retrieving dependents after Orion restart


Here is an excerpt from orion-ejb-jar.xml, can someone tell me if I have
something configured incorrectly.  Again, the data is properly written to
the database, it is just NOT READ when orion is restarted and
getPhoneDependents() api is executed.

entity-deployment name="ejb.person.PersonEntity"
location="ejb.person.PersonEntity"
wrapper="PersonEntityHome_EntityHomeWrapper33"
table="ejb_person_PersonEntity" data-source="jdbc/siteDS"
  primkey-mapping
cmp-field-mapping
  fields
  cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  cmp-field-mapping name="salutation" persistence-name="salutation" /
  cmp-field-mapping name="name" persistence-name="name" /
  cmp-field-mapping name="email" persistence-name="email" /
  cmp-field-mapping name="phoneDependents"
collection-mapping table="ejb_phones"
  primkey-mapping
cmp-field-mapping
  fields
cmp-field-mapping name="id" persistence-name="id" /
  /fields
/cmp-field-mapping
  /primkey-mapping
  value-mapping type="ejb.person.PersonPhone"
cmp-field-mapping name="value"
  properties
cmp-field-mapping name="id" persistence-name="id" /
cmp-field-mapping name="number" persistence-name="number" /
cmp-field-mapping name="person"
  entity-ref home="ejb.person.PersonEntity"
cmp-field-mapping name="person"
  fields
cmp-field-mapping name="id" persistence-name="ownerId"
/
  /fields
/cmp-field-mapping
  /entity-ref
/cmp-field-mapping
  /properties
/cmp-field-mapping
  /value-mapping
/collection-mapping
  /cmp-field-mapping
  ejb-ref-mapping name="ejb/id" /
/entity-deployment

Again, the ejb.person.PersonEntity has a 1 to N relation with dependend
ejb.pers.PersonPhone.

Thanks.
-AP_

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Paransky
Sent: Monday, March 05, 2001 1:18 PM
To