Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » teneo:circular loop on DB2 error
teneo:circular loop on DB2 error [message #114707] Thu, 13 March 2008 21:03 Go to next message
Julia is currently offline JuliaFriend
Messages: 85
Registered: July 2009
Member
Hi Martin,

I'm using teneo with DB2 and on certain section of my meta-data during my
database initialize returns me an error which is essentially a loop -
table a is connect to table b to table c to table a.

DB21034E The command was processed as an SQL statement because it was not
a valid Command Line Processor command. During SQL processing it
returned: SQL20254N FOREIGN KEY "NVGTNLMN_LYTLMNTR" is not valid since it
would cause
table "DB2INST1.NAVIGATIONELEMENT" to be delete-connected to itself
through a cycle that contains a delete rule of either RESTRICT or SET
NULL. Reason code = "1". SQLSTATE=42915

DB2 was able to pinpoint where this happens and am able to replicate it on
a small sample.

If I make a substitution change in one of the element (for loop:Text and
copy Text into Preference), the problem goes away.

eg

<xs:complexType name="Preference">
<xs:sequence>
<xs:element name="value" type="loop:Text" minOccurs="0"
maxOccurs="unbounded"/> <--- use actual Text here
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>

I'm not sure if this is a bug or not. Perhaps changing my settings on how
I generate jdo might be a workaround for this problem. Currently I am using

FETCH_CONTAINMENT_EAGERLY = "true"
JOIN_COLUMN_NAMING_STRATEGY = "simple"
MAXIMUM_SQL_NAME_LENGTH = "18"
INHERITANCE_MAPPING = JOINED/SINGLE_TABLE (tried both)

Is there any other settings that you think I can try? I sent you my simple
sample just in case you want to try it. Thanks.

Julia
Re: teneo:circular loop on DB2 error [message #114816 is a reply to message #114707] Fri, 14 March 2008 13:39 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
I have been searching the internet for this issue. I have tested with mysql and it works fine.
I don't run db2 so it is difficult for me to reproduce it.

You sent me a smaller test case directly, what db2 error message do you get on that one? Then I know
which table/foreign key to look for.

gr. Martin

Julia wrote:
> Hi Martin,
>
> I'm using teneo with DB2 and on certain section of my meta-data during
> my database initialize returns me an error which is essentially a loop -
> table a is connect to table b to table c to table a.
>
> DB21034E The command was processed as an SQL statement because it was
> not a valid Command Line Processor command. During SQL processing it
> returned: SQL20254N FOREIGN KEY "NVGTNLMN_LYTLMNTR" is not valid since
> it would cause
> table "DB2INST1.NAVIGATIONELEMENT" to be delete-connected to itself
> through a cycle that contains a delete rule of either RESTRICT or SET
> NULL. Reason code = "1". SQLSTATE=42915
>
> DB2 was able to pinpoint where this happens and am able to replicate it
> on a small sample.
> If I make a substitution change in one of the element (for loop:Text and
> copy Text into Preference), the problem goes away.
>
> eg
> <xs:complexType name="Preference">
> <xs:sequence>
> <xs:element name="value" type="loop:Text" minOccurs="0"
> maxOccurs="unbounded"/> <--- use actual Text here
> </xs:sequence>
> <xs:attribute name="name" type="xs:string" use="required"/>
> </xs:complexType>
>
> I'm not sure if this is a bug or not. Perhaps changing my settings on
> how I generate jdo might be a workaround for this problem. Currently I
> am using
>
> FETCH_CONTAINMENT_EAGERLY = "true"
> JOIN_COLUMN_NAMING_STRATEGY = "simple"
> MAXIMUM_SQL_NAME_LENGTH = "18"
> INHERITANCE_MAPPING = JOINED/SINGLE_TABLE (tried both)
>
> Is there any other settings that you think I can try? I sent you my
> simple sample just in case you want to try it. Thanks.
>
> Julia
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: teneo:circular loop on DB2 error [message #114877 is a reply to message #114707] Mon, 17 March 2008 05:09 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
I think the sql is wrong (because the mapping is wrong) in case of a contained many-to-one. Normally
for a many-to-one teneo will set the
fk on the many side. However in this case this results in a foreign key cascade which goes the wrong
way. Currently the reference is from the layoutelement to the text object. Which means that with
cascade delete that when the text gets deleted the layoutelement is also deleted. The required
behavior is the opposite: when the layoutelement is deleted then also its children should be
deleted. In a way a contained many-to-one should be treated as a one-to-one.
As a solution: Teneo should not create an explicit fk constraint but let jpox handle it (through the
dependent element).

Can you enter a bugzilla for this?

For now the only solution I can think of is remove the explicit foreign-key elements in the text
fields in the package.jdo.

gr. Martin

Julia wrote:
> Hi Martin,
>
> I'm using teneo with DB2 and on certain section of my meta-data during
> my database initialize returns me an error which is essentially a loop -
> table a is connect to table b to table c to table a.
>
> DB21034E The command was processed as an SQL statement because it was
> not a valid Command Line Processor command. During SQL processing it
> returned: SQL20254N FOREIGN KEY "NVGTNLMN_LYTLMNTR" is not valid since
> it would cause
> table "DB2INST1.NAVIGATIONELEMENT" to be delete-connected to itself
> through a cycle that contains a delete rule of either RESTRICT or SET
> NULL. Reason code = "1". SQLSTATE=42915
>
> DB2 was able to pinpoint where this happens and am able to replicate it
> on a small sample.
> If I make a substitution change in one of the element (for loop:Text and
> copy Text into Preference), the problem goes away.
>
> eg
> <xs:complexType name="Preference">
> <xs:sequence>
> <xs:element name="value" type="loop:Text" minOccurs="0"
> maxOccurs="unbounded"/> <--- use actual Text here
> </xs:sequence>
> <xs:attribute name="name" type="xs:string" use="required"/>
> </xs:complexType>
>
> I'm not sure if this is a bug or not. Perhaps changing my settings on
> how I generate jdo might be a workaround for this problem. Currently I
> am using
>
> FETCH_CONTAINMENT_EAGERLY = "true"
> JOIN_COLUMN_NAMING_STRATEGY = "simple"
> MAXIMUM_SQL_NAME_LENGTH = "18"
> INHERITANCE_MAPPING = JOINED/SINGLE_TABLE (tried both)
>
> Is there any other settings that you think I can try? I sent you my
> simple sample just in case you want to try it. Thanks.
>
> Julia
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: teneo:circular loop on DB2 error [message #615887 is a reply to message #114707] Fri, 14 March 2008 13:39 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
I have been searching the internet for this issue. I have tested with mysql and it works fine.
I don't run db2 so it is difficult for me to reproduce it.

You sent me a smaller test case directly, what db2 error message do you get on that one? Then I know
which table/foreign key to look for.

gr. Martin

Julia wrote:
> Hi Martin,
>
> I'm using teneo with DB2 and on certain section of my meta-data during
> my database initialize returns me an error which is essentially a loop -
> table a is connect to table b to table c to table a.
>
> DB21034E The command was processed as an SQL statement because it was
> not a valid Command Line Processor command. During SQL processing it
> returned: SQL20254N FOREIGN KEY "NVGTNLMN_LYTLMNTR" is not valid since
> it would cause
> table "DB2INST1.NAVIGATIONELEMENT" to be delete-connected to itself
> through a cycle that contains a delete rule of either RESTRICT or SET
> NULL. Reason code = "1". SQLSTATE=42915
>
> DB2 was able to pinpoint where this happens and am able to replicate it
> on a small sample.
> If I make a substitution change in one of the element (for loop:Text and
> copy Text into Preference), the problem goes away.
>
> eg
> <xs:complexType name="Preference">
> <xs:sequence>
> <xs:element name="value" type="loop:Text" minOccurs="0"
> maxOccurs="unbounded"/> <--- use actual Text here
> </xs:sequence>
> <xs:attribute name="name" type="xs:string" use="required"/>
> </xs:complexType>
>
> I'm not sure if this is a bug or not. Perhaps changing my settings on
> how I generate jdo might be a workaround for this problem. Currently I
> am using
>
> FETCH_CONTAINMENT_EAGERLY = "true"
> JOIN_COLUMN_NAMING_STRATEGY = "simple"
> MAXIMUM_SQL_NAME_LENGTH = "18"
> INHERITANCE_MAPPING = JOINED/SINGLE_TABLE (tried both)
>
> Is there any other settings that you think I can try? I sent you my
> simple sample just in case you want to try it. Thanks.
>
> Julia
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: teneo:circular loop on DB2 error [message #615894 is a reply to message #114707] Mon, 17 March 2008 05:09 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Julia,
I think the sql is wrong (because the mapping is wrong) in case of a contained many-to-one. Normally
for a many-to-one teneo will set the
fk on the many side. However in this case this results in a foreign key cascade which goes the wrong
way. Currently the reference is from the layoutelement to the text object. Which means that with
cascade delete that when the text gets deleted the layoutelement is also deleted. The required
behavior is the opposite: when the layoutelement is deleted then also its children should be
deleted. In a way a contained many-to-one should be treated as a one-to-one.
As a solution: Teneo should not create an explicit fk constraint but let jpox handle it (through the
dependent element).

Can you enter a bugzilla for this?

For now the only solution I can think of is remove the explicit foreign-key elements in the text
fields in the package.jdo.

gr. Martin

Julia wrote:
> Hi Martin,
>
> I'm using teneo with DB2 and on certain section of my meta-data during
> my database initialize returns me an error which is essentially a loop -
> table a is connect to table b to table c to table a.
>
> DB21034E The command was processed as an SQL statement because it was
> not a valid Command Line Processor command. During SQL processing it
> returned: SQL20254N FOREIGN KEY "NVGTNLMN_LYTLMNTR" is not valid since
> it would cause
> table "DB2INST1.NAVIGATIONELEMENT" to be delete-connected to itself
> through a cycle that contains a delete rule of either RESTRICT or SET
> NULL. Reason code = "1". SQLSTATE=42915
>
> DB2 was able to pinpoint where this happens and am able to replicate it
> on a small sample.
> If I make a substitution change in one of the element (for loop:Text and
> copy Text into Preference), the problem goes away.
>
> eg
> <xs:complexType name="Preference">
> <xs:sequence>
> <xs:element name="value" type="loop:Text" minOccurs="0"
> maxOccurs="unbounded"/> <--- use actual Text here
> </xs:sequence>
> <xs:attribute name="name" type="xs:string" use="required"/>
> </xs:complexType>
>
> I'm not sure if this is a bug or not. Perhaps changing my settings on
> how I generate jdo might be a workaround for this problem. Currently I
> am using
>
> FETCH_CONTAINMENT_EAGERLY = "true"
> JOIN_COLUMN_NAMING_STRATEGY = "simple"
> MAXIMUM_SQL_NAME_LENGTH = "18"
> INHERITANCE_MAPPING = JOINED/SINGLE_TABLE (tried both)
>
> Is there any other settings that you think I can try? I sent you my
> simple sample just in case you want to try it. Thanks.
>
> Julia
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Unnecessary resetting of object references
Next Topic:[Teneo] Hibernate Library Editor Turorial - can't load URI
Goto Forum:
  


Current Time: Sun Jun 13 05:08:57 GMT 2021

Powered by FUDForum. Page generated in 0.01472 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top