Discussion:
Problem relationship with 2 eomodels
Pierre Gilquin
2009-10-29 09:33:19 UTC
Permalink
Hi all,
 
I have 2 eomodels one using MySql and the second
Oracle.
 
I have the following Entities : EntityAFromModel1,
EntityBFromModel1and EntityCFromModel2
EntityAFromModel1 has a to-many relationship with
EntityBFromModel1.
EntityBFromModel1 has a to-one relationship
with EntityCFromModel2. This relation crosses the 2 models.
 
When fetching EntityAFromModel1, I get the
following error when accessing the to-one relationship to EntityCFromModel2 :
java.lang.IllegalStateException: Server exception:
The object with globalID _EOIntegralKeyGlobalID[EntityCFromModel2
(java.lang.Integer)16823]could not be found in the database. This could be
result of a referential integrity problem with the database. An empty fault
could not be created because the object's class could not be determined (e.g.
the GID is temporary or it is for an abstract entity).
 
No SQL statement is send to the Oracle
Database.
 
The only thing I find for help is to fetch all
EntityCFromModel2 at the Application start. But it is not very practical has
EntityCFromModel2 has a lot of instances. Moreover, I am sure that it will still
work a long time after the start.
 
I thought also to implement awakeFromFetch in
EntityBFromModel1 in order to fetch the instance needed for the relationship but
without success.
 
 
Do you have a better idea to make this relationship
works between 2 models working ?
 
 
Thank in advance.
 
Pierre
WO 5.2.4
_________________________________________________________________
La Suisse reçoit plus d'espace! Votre disque dur virtuel de 25 Go avec Windows Live SkyDrive.
http://skydrive.live.com
Kieran Kelleher
2009-10-29 10:51:35 UTC
Permalink
Have you tried this with latest Project Wonder and WO 5.3.3?
Post by Pierre Gilquin
Hi all,
I have 2 eomodels one using MySql and the second
Oracle.
I have the following Entities : EntityAFromModel1,
EntityBFromModel1and EntityCFromModel2
EntityAFromModel1 has a to-many relationship with
EntityBFromModel1.
EntityBFromModel1 has a to-one relationship
with EntityCFromModel2. This relation crosses the 2 models.
When fetching EntityAFromModel1, I get the
following error when accessing the to-one relationship to
The object with globalID _EOIntegralKeyGlobalID[EntityCFromModel2
(java.lang.Integer)16823]could not be found in the database. This could be
result of a referential integrity problem with the database. An empty fault
could not be created because the object's class could not be
determined (e.g.
the GID is temporary or it is for an abstract entity).
No SQL statement is send to the Oracle
Database.
The only thing I find for help is to fetch all
EntityCFromModel2 at the Application start. But it is not very
practical has
EntityCFromModel2 has a lot of instances. Moreover, I am sure that
it will still
work a long time after the start.
I thought also to implement awakeFromFetch in
EntityBFromModel1 in order to fetch the instance needed for the relationship but
without success.
Do you have a better idea to make this relationship
works between 2 models working ?
Thank in advance.
Pierre
WO 5.2.4
_________________________________________________________________
La Suisse reçoit plus d'espace! Votre disque dur virtuel de 25 Go
avec Windows Live SkyDrive.
http://
skydrive.live.com_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
Pierre Gilquin
2009-10-29 11:15:05 UTC
Permalink
<D55E1855-B1CE-4E4A-94E7-***@mac.com>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0


I don't have choice=2C deployment is on WO 5.2.4
Thanks

----------------------------------------
Subject: Re: Problem relationship with 2 eomodels
Date: Thu=2C 29 Oct 2009 06:51:35 -0400
Have you tried this with latest Project Wonder and WO 5.3.3?
Hi all=2C
I have 2 eomodels one using MySql and the second
Oracle.
I have the following Entities : EntityAFromModel1=2C
EntityBFromModel1and EntityCFromModel2
EntityAFromModel1 has a to-many relationship with
EntityBFromModel1.
EntityBFromModel1 has a to-one relationship
with EntityCFromModel2. This relation crosses the 2 models.
When fetching EntityAFromModel1=2C I get the
following error when accessing the to-one relationship to
The object with globalID _EOIntegralKeyGlobalID[EntityCFromModel2
(java.lang.Integer)16823]could not be found in the database. This could be
result of a referential integrity problem with the database. An empty fault
could not be created because the object's class could not be
determined (e.g.
the GID is temporary or it is for an abstract entity).
No SQL statement is send to the Oracle
Database.
The only thing I find for help is to fetch all
EntityCFromModel2 at the Application start. But it is not very practical has
EntityCFromModel2 has a lot of instances. Moreover=2C I am sure that
it will still
work a long time after the start.
I thought also to implement awakeFromFetch in
EntityBFromModel1 in order to fetch the instance needed for the relationship but
without success.
Do you have a better idea to make this relationship
works between 2 models working ?
Thank in advance.
Pierre
WO 5.2.4
_________________________________________________________________
La Suisse re=E7oit plus d'espace! Votre disque dur virtuel de 25 Go
avec Windows Live SkyDrive.
http://
skydrive.live.com_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
=20
_________________________________________________________________
La Suisse re=E7oit plus d'espace! Votre disque dur virtuel de 25 Go avec Wi=
ndows Live SkyDrive.
http://skydrive.live.com=
objectwerks inc
2009-10-30 18:00:19 UTC
Permalink
Post by Pierre Gilquin
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
I don't have choice=2C deployment is on WO 5.2.4
Thanks
Btw, if it helps, you can embed the WO libs into your app so it does
not matter what the target machine has as installed WO. It will use
the embedded WO libs instead. Just set the classpath stuff correctly

Chad
Post by Pierre Gilquin
----------------------------------------
Subject: Re: Problem relationship with 2 eomodels
Date: Thu=2C 29 Oct 2009 06:51:35 -0400
Have you tried this with latest Project Wonder and WO 5.3.3?
Hi all=2C
I have 2 eomodels one using MySql and the second
Oracle.
I have the following Entities : EntityAFromModel1=2C
EntityBFromModel1and EntityCFromModel2
EntityAFromModel1 has a to-many relationship with
EntityBFromModel1.
EntityBFromModel1 has a to-one relationship
with EntityCFromModel2. This relation crosses the 2 models.
When fetching EntityAFromModel1=2C I get the
following error when accessing the to-one relationship to
The object with globalID _EOIntegralKeyGlobalID[EntityCFromModel2
(java.lang.Integer)16823]could not be found in the database. This could be
result of a referential integrity problem with the database. An empty fault
could not be created because the object's class could not be
determined (e.g.
the GID is temporary or it is for an abstract entity).
No SQL statement is send to the Oracle
Database.
The only thing I find for help is to fetch all
EntityCFromModel2 at the Application start. But it is not very practical has
EntityCFromModel2 has a lot of instances. Moreover=2C I am sure that
it will still
work a long time after the start.
I thought also to implement awakeFromFetch in
EntityBFromModel1 in order to fetch the instance needed for the relationship but
without success.
Do you have a better idea to make this relationship
works between 2 models working ?
Thank in advance.
Pierre
WO 5.2.4
_________________________________________________________________
La Suisse re=E7oit plus d'espace! Votre disque dur virtuel de 25 Go
avec Windows Live SkyDrive.
http://
skydrive.live.com_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
=20
_________________________________________________________________
La Suisse re=E7oit plus d'espace! Votre disque dur virtuel de 25 Go avec Wi=
ndows Live SkyDrive.
http://skydrive.live.com=
_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
Pierre Gilquin
2009-10-31 07:58:32 UTC
Permalink
Post by objectwerks inc
Btw, if it helps, you can embed the WO libs into your app so it does
not matter what the target machine has as installed WO. It will use
the embedded WO libs instead. Just set the classpath stuff correctly
Chad
Thanks Chad,

I wil try this idea.
What frameworks from WO 5.3.3, i have to put in first position ?
javaeocontrol.jar, javaeoaccess.jar ...
As I use this in a java client probably javaeodistribution.jar (wojavaclient.jar on the client) as well.

Pierre
Pierre G
2009-10-30 08:13:11 UTC
Permalink
I found the way to make it work in awakeFromFetch of EntityBFromModel1.
I had to set the id used for the to-one relationship in the class and I was
abled to fetch the corresponding EntityCFromModel2 :

public void awakeFromFetch(EOEditingContext ec)
{
EntityCFromModel2 entC =
(EntityCFromModel2)EOUtilities.objectWithPrimaryKeyValue(ec,"EntityCFromModel2",
idForRelation());
}

better idea ?
Post by Pierre Gilquin
Hi all,
 
I have 2 eomodels one using MySql and the second
Oracle.
 
I have the following Entities : EntityAFromModel1,
EntityBFromModel1and EntityCFromModel2
EntityAFromModel1 has a to-many relationship with
EntityBFromModel1.
EntityBFromModel1 has a to-one relationship
with EntityCFromModel2. This relation crosses the 2 models.
 
When fetching EntityAFromModel1, I get the
following error when accessing the to-one relationship to
The object with globalID _EOIntegralKeyGlobalID[EntityCFromModel2
(java.lang.Integer)16823]could not be found in the database. This could be
result of a referential integrity problem with the database. An empty
fault
could not be created because the object's class could not be determined
(e.g.
the GID is temporary or it is for an abstract entity).
 
No SQL statement is send to the Oracle
Database.
 
The only thing I find for help is to fetch all
EntityCFromModel2 at the Application start. But it is not very practical
has
EntityCFromModel2 has a lot of instances. Moreover, I am sure that it will
still
work a long time after the start.
 
I thought also to implement awakeFromFetch in
EntityBFromModel1 in order to fetch the instance needed for the
relationship but
without success.
 
 
Do you have a better idea to make this relationship
works between 2 models working ?
 
 
Thank in advance.
 
Pierre
WO 5.2.4
_________________________________________________________________
--
View this message in context: http://old.nabble.com/Problem-relationship-with-2-eomodels-tp26109808p26116207.html
Sent from the WebObjects-Dev mailing list archive at Nabble.com.
Chuck Hill
2009-11-02 21:07:27 UTC
Permalink
I recall that having relationships between entities in different
databases is problematic in EOF. I don't recall ever doing this. I
don't recall if this is completely non-functional, or if there are
just some bugs. There is no reason that I can think of that it could
not work.


Chuck
Post by Pierre Gilquin
Hi all,
I have 2 eomodels one using MySql and the second
Oracle.
I have the following Entities : EntityAFromModel1,
EntityBFromModel1and EntityCFromModel2
EntityAFromModel1 has a to-many relationship with
EntityBFromModel1.
EntityBFromModel1 has a to-one relationship
with EntityCFromModel2. This relation crosses the 2 models.
When fetching EntityAFromModel1, I get the
following error when accessing the to-one relationship to
The object with globalID _EOIntegralKeyGlobalID[EntityCFromModel2
(java.lang.Integer)16823]could not be found in the database. This could be
result of a referential integrity problem with the database. An empty fault
could not be created because the object's class could not be
determined (e.g.
the GID is temporary or it is for an abstract entity).
No SQL statement is send to the Oracle
Database.
The only thing I find for help is to fetch all
EntityCFromModel2 at the Application start. But it is not very
practical has
EntityCFromModel2 has a lot of instances. Moreover, I am sure that
it will still
work a long time after the start.
I thought also to implement awakeFromFetch in
EntityBFromModel1 in order to fetch the instance needed for the relationship but
without success.
Do you have a better idea to make this relationship
works between 2 models working ?
Thank in advance.
Pierre
WO 5.2.4
_________________________________________________________________
La Suisse reçoit plus d'espace! Votre disque dur virtuel de 25 Go
avec Windows Live SkyDrive.
http://
skydrive.live.com_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
Travis Britt
2009-11-03 02:25:25 UTC
Permalink
It's been a couple years, and my experience was on two different
Oracle databases, but IIRC it works so long as you don't try to pre-
fetch the relationship. (Or, heaven forbid, create a qualifier that
attempts to traverse the relationship.)

tb
Post by Chuck Hill
I recall that having relationships between entities in different
databases is problematic in EOF. I don't recall ever doing this. I
don't recall if this is completely non-functional, or if there are
just some bugs. There is no reason that I can think of that it
could not work.
Chuck
Post by Pierre Gilquin
Hi all,
I have 2 eomodels one using MySql and the second
Oracle.
I have the following Entities : EntityAFromModel1,
EntityBFromModel1and EntityCFromModel2
EntityAFromModel1 has a to-many relationship with
EntityBFromModel1.
EntityBFromModel1 has a to-one relationship
with EntityCFromModel2. This relation crosses the 2 models.
When fetching EntityAFromModel1, I get the
following error when accessing the to-one relationship to
The object with globalID _EOIntegralKeyGlobalID[EntityCFromModel2
(java.lang.Integer)16823]could not be found in the database. This could be
result of a referential integrity problem with the database. An empty fault
could not be created because the object's class could not be
determined (e.g.
the GID is temporary or it is for an abstract entity).
No SQL statement is send to the Oracle
Database.
The only thing I find for help is to fetch all
EntityCFromModel2 at the Application start. But it is not very practical has
EntityCFromModel2 has a lot of instances. Moreover, I am sure that
it will still
work a long time after the start.
I thought also to implement awakeFromFetch in
EntityBFromModel1 in order to fetch the instance needed for the relationship but
without success.
Do you have a better idea to make this relationship
works between 2 models working ?
Thank in advance.
Pierre
WO 5.2.4
_________________________________________________________________
La Suisse reçoit plus d'espace! Votre disque dur virtuel de 25 Go
avec Windows Live SkyDrive.
http://skydrive.live.com_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
Clark Mueller
2009-11-03 03:15:51 UTC
Permalink
It's a problem if you do anything that would cause EOF to write SQL
that does a join, which is definitely when you're doing prefetches or
constructing a qualifier that touches both models. Traversing the
relationships in memory works. For example, if you have A with a
relationship to B in separate databases, you should be able to do
someA.getB() since this will ultimately only require the value of A's
primary key in B's database when the SQL is generated.

You would probably want to turn on adaptor debug to see what SQL is
being generated for your particular case, and be prepared to do some
of the work in memory. From your description it sounds like you're
fetching EntityAFromModel1 with a qualifier that touches
EntityCFromModel2, and it's generating the SQL in the database for
Model1.

Clark
Post by Travis Britt
It's been a couple years, and my experience was on two different
Oracle databases, but IIRC it works so long as you don't try to pre-
fetch the relationship. (Or, heaven forbid, create a qualifier that
attempts to traverse the relationship.)
tb
Post by Chuck Hill
I recall that having relationships between entities in different
databases is problematic in EOF. I don't recall ever doing this.
I don't recall if this is completely non-functional, or if there
are just some bugs. There is no reason that I can think of that it
could not work.
Chuck
Post by Pierre Gilquin
Hi all,
I have 2 eomodels one using MySql and the second
Oracle.
I have the following Entities : EntityAFromModel1,
EntityBFromModel1and EntityCFromModel2
EntityAFromModel1 has a to-many relationship with
EntityBFromModel1.
EntityBFromModel1 has a to-one relationship
with EntityCFromModel2. This relation crosses the 2 models.
When fetching EntityAFromModel1, I get the
following error when accessing the to-one relationship to
The object with globalID _EOIntegralKeyGlobalID[EntityCFromModel2
(java.lang.Integer)16823]could not be found in the database. This could be
result of a referential integrity problem with the database. An empty fault
could not be created because the object's class could not be
determined (e.g.
the GID is temporary or it is for an abstract entity).
No SQL statement is send to the Oracle
Database.
The only thing I find for help is to fetch all
EntityCFromModel2 at the Application start. But it is not very practical has
EntityCFromModel2 has a lot of instances. Moreover, I am sure that
it will still
work a long time after the start.
I thought also to implement awakeFromFetch in
EntityBFromModel1 in order to fetch the instance needed for the relationship but
without success.
Do you have a better idea to make this relationship
works between 2 models working ?
Thank in advance.
Pierre
WO 5.2.4
_________________________________________________________________
La Suisse reçoit plus d'espace! Votre disque dur virtuel de 25 Go
avec Windows Live SkyDrive.
http://skydrive.live.com_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
_______________________________________________
WebObjects-dev mailing list
http://www.omnigroup.com/mailman/listinfo/webobjects-dev
Pierre Gilquin
2009-11-03 08:18:43 UTC
Permalink
You would probably want to turn on adaptor debug to see what SQL is being generated for your particular case, and be
prepared to do some of the work in memory.
Loading...