You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Marianne Hagaseth <Ma...@marintek.sintef.no> on 2015/03/06 14:51:00 UTC

Not able to add 1:m bidirectional relationship

Hi,
I am trying to add a 1:m bidirectional relationship, but it fails.
I wonder if  could be a mismatch between the versions used for some of the stuff needed.
My set up looks like:


*        isis-core-webserver 1.7.0

*        datanucleus-api-jdo-3.2.7

*        Eclipse Java EE IDE 4.4.2

*        mysql-connector-java-5.1.34

*        mysql server 5.6.23

*        Jdk 1.7.0_75


It fails here at backingStore.add(...):

                try

                {

                    backingStore.add(ownerOP,element, (useCache ? delegate.size() : -1));

                }

                catch (NucleusDataStoreException dse)

                {

                    NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013", "add", ownerMmd.getName(), dse));

                    backingSuccess = false;

                }
With Error message:

12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]  org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)

12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]  org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)

12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]  Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)

12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]  Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)

12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN ]  Execution of method "add" on field "clauses" caused an error : Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)

Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)

org.datanucleus.exceptions.NucleusDataStoreException: Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)

        at org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)

        at org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)

        at dom.regulation.Regulation.addClause(Regulation.java:795)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


etc.etc...

Best regards,
Marianne Hagaseth


Re: Not able to add 1:m bidirectional relationship

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
OK; if you want to use lists, the starting article to read is:
http://www.datanucleus.org/products/datanucleus/jdo/orm/embedded.html#Collection

On 6 March 2015 at 14:29, Dan Haywood <da...@haywood-associates.co.uk> wrote:

> I just posted that last mail, and then I figured out what the problem
> probably is.
>
> I bet you have an entity that has a collection of clauses, and that the
> collection is a List<...>.
>
> In which case the "idx" is added by DN in order that the sequence of those
> clause objects can be preserved.
>
> One easy fix (which we do) is to convert to a SortedSet, and have your
> RegulationClause implement Comparable.
>
> But let me go check up on the "correct" way to do lists in DN.
>
> HTH
> Dan
>
>
>
>
>
>
> On 6 March 2015 at 14:27, Dan Haywood <da...@haywood-associates.co.uk>
> wrote:
>
>> Hi Marianne,
>>
>> If "Idx" isn't a property that you've explicitly added, then it's
>> probably been added through some DN annotation that you have (is my guess).
>>
>> So, could you show us the DN annotations for the entity that's mapped to
>> the failing table ("regulation_clauses").  (Or, the annotations for the
>> collection if that's what it actually is).
>>
>> ~~~
>> Also, let's enable some extra logging.
>>
>> In WEB-INF/logging.properties, switch these two properties to DEBUG:
>>
>> # DataNucleus
>> # the first two log the DML and DDL (if set to DEBUG)
>> log4j.logger.DataNucleus.Datastore.Native=DEBUG, Console
>> log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
>>
>>
>> Also, in persistor.properties, you could enable the log4jdbc-remix
>> driver, eg, if using hsqldb then comment out:
>>
>>
>> #isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
>>
>> #isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:mem:test
>> #isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
>> #isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
>>
>> and replace with (below):
>>
>>
>> isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
>>
>> isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test
>> isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
>> isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
>>
>>
>> Hopefully in your console you'll be able to search for 'idx' and we'll
>> get a clue what it relates to.
>>
>>
>>
>> Thx
>> Dan
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On 6 March 2015 at 14:19, Marianne Hagaseth <
>> Marianne.Hagaseth@marintek.sintef.no> wrote:
>>
>>> Thanks for replying so quickly!
>>>
>>> 'Idx' is not a field added by me, thus, it is created by Isis/DN, I
>>> think?
>>> Some index-stuff for the database table?
>>>
>>> Best,
>>> Marianne.
>>>
>>> -----Original Message-----
>>> From: Martin Grigorov [mailto:mgrigorov@apache.org]
>>> Sent: 6. mars 2015 15:10
>>> To: users
>>> Subject: Re: Not able to add 1:m bidirectional relationship
>>>
>>>  java.sql.SQLException: Field 'idx' doesn't have a default value
>>>
>>> Do you have an entity with field 'idx' in your model ?
>>> Or it could be something created by Isis/DN, I don't know.
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Fri, Mar 6, 2015 at 4:06 PM, Marianne Hagaseth <
>>> Marianne.Hagaseth@marintek.sintef.no> wrote:
>>>
>>> > Yes, a lot. See below.
>>> > It seems like the values are not picked up, and then the insert into
>>> > the database tables fails because the columns are NOT NULL and no
>>> > default values exists.
>>> >
>>> > Some more from the STACK:
>>> >
>>> > Caused by:
>>> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>>> >         ... 71 more
>>> > Caused by: java.sql.SQLException: Field 'idx' doesn't have a default
>>> > value
>>> >
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> > And more:
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> >
>>> >         ... 73 more
>>> > Nested Throwables StackTrace:
>>> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>>> >         at
>>> > org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSe
>>> > tStore.java:754)
>>> >
>>> >         at
>>> >
>>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>>> >         at
>>> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
>>> > va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a
>>> > default value
>>> >         at
>>> > com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>>> >
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>>> >         ... 73 more
>>> >
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> > And more:
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> >
>>> > 14:45:38,105  [Persistence          1661257338@qtp-721005297-3 WARN ]
>>> > Execution of method "add" on field "clauses" caused an error : Add
>>> > request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
>>> > (?,?) Add request failed : INSERT INTO regulation_clauses
>>> > (id_oid,id_eid) VALUES
>>> > (?,?)
>>> > org.datanucleus.exceptions.NucleusDataStoreException: Add request
>>> failed :
>>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)
>>> >         at
>>> > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>>> >
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> > And more:
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> >
>>> >         at
>>> >
>>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>>> >         at
>>> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
>>> > va:582)
>>> > Caused by:
>>> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>>> >         ... 71 more
>>> > Caused by: java.sql.SQLException: Field 'idx' doesn't have a default
>>> value
>>> >         at
>>> com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>>> >         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
>>> >
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> > And more:
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> >
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>>> >         ... 73 more
>>> > Nested Throwables StackTrace:
>>> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>>> >         at
>>> >
>>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>>> >         at
>>> > org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetS
>>> > tore.java:502)
>>> >
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> > And more:
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> >
>>> >         at
>>> >
>>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>>> >         at
>>> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
>>> > va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a
>>> > default value
>>> >         at
>>> > com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>>> >
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> > And more:
>>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>>> >
>>> > Best
>>> > -Marianne.
>>> >
>>> > -----Original Message-----
>>> > From: Martin Grigorov [mailto:mgrigorov@apache.org]
>>> > Sent: 6. mars 2015 14:53
>>> > To: users
>>> > Subject: Re: Not able to add 1:m bidirectional relationship
>>> >
>>> > Hi,
>>> >
>>> >
>>> > On Fri, Mar 6, 2015 at 3:51 PM, Marianne Hagaseth <
>>> > Marianne.Hagaseth@marintek.sintef.no> wrote:
>>> >
>>> > > Hi,
>>> > > I am trying to add a 1:m bidirectional relationship, but it fails.
>>> > > I wonder if  could be a mismatch between the versions used for some
>>> > > of the stuff needed.
>>> > > My set up looks like:
>>> > >
>>> > >
>>> > > *        isis-core-webserver 1.7.0
>>> > >
>>> > > *        datanucleus-api-jdo-3.2.7
>>> > >
>>> > > *        Eclipse Java EE IDE 4.4.2
>>> > >
>>> > > *        mysql-connector-java-5.1.34
>>> > >
>>> > > *        mysql server 5.6.23
>>> > >
>>> > > *        Jdk 1.7.0_75
>>> > >
>>> > >
>>> > > It fails here at backingStore.add(...):
>>> > >
>>> > >                 try
>>> > >
>>> > >                 {
>>> > >
>>> > >                     backingStore.add(ownerOP,element, (useCache ?
>>> > > delegate.size() : -1));
>>> > >
>>> > >                 }
>>> > >
>>> > >                 catch (NucleusDataStoreException dse)
>>> > >
>>> > >                 {
>>> > >
>>> > >
>>> > > NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013",
>>> > > "add", ownerMmd.getName(), dse));
>>> > >
>>> > >                     backingSuccess = false;
>>> > >
>>> > >                 }
>>> > > With Error message:
>>> > >
>>> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3
>>> ERROR]
>>> > > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>>> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>>> > >
>>> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3
>>> ERROR]
>>> > > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>>> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>>> > >
>>> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3
>>> ERROR]
>>> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
>>> > > VALUES
>>> > > (?,?)
>>> > >
>>> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3
>>> ERROR]
>>> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
>>> > > VALUES
>>> > > (?,?)
>>> > >
>>> > > 12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN
>>> ]
>>> > > Execution of method "add" on field "clauses" caused an error : Add
>>> > > request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
>>> > > VALUES
>>> > > (?,?)
>>> > >
>>> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
>>> > > VALUES
>>> > > (?,?)
>>> > >
>>> > > org.datanucleus.exceptions.NucleusDataStoreException: Add request
>>> > > failed
>>> > :
>>> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>>> > >
>>> > >         at
>>> > > org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.j
>>> > > av
>>> > > a:349)
>>> > >
>>> > >         at
>>> > > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>>> > >
>>> > >         at dom.regulation.Regulation.addClause(Regulation.java:795)
>>> > >
>>> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> > > Method)
>>> > >
>>> > >         at
>>> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
>>> > > .j
>>> > > ava:57)
>>> > >
>>> > >         at
>>> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
>>> > > ss
>>> > > orImpl.java:43)
>>> > >
>>> > >
>>> > > etc.etc...
>>> > >
>>> >
>>> > Is there "Caused by: ..." down in the stack ?
>>> >
>>> >
>>> > >
>>> > > Best regards,
>>> > > Marianne Hagaseth
>>> > >
>>> > >
>>> >
>>>
>>
>>
>

Re: Not able to add 1:m bidirectional relationship

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
I just posted that last mail, and then I figured out what the problem
probably is.

I bet you have an entity that has a collection of clauses, and that the
collection is a List<...>.

In which case the "idx" is added by DN in order that the sequence of those
clause objects can be preserved.

One easy fix (which we do) is to convert to a SortedSet, and have your
RegulationClause implement Comparable.

But let me go check up on the "correct" way to do lists in DN.

HTH
Dan






On 6 March 2015 at 14:27, Dan Haywood <da...@haywood-associates.co.uk> wrote:

> Hi Marianne,
>
> If "Idx" isn't a property that you've explicitly added, then it's probably
> been added through some DN annotation that you have (is my guess).
>
> So, could you show us the DN annotations for the entity that's mapped to
> the failing table ("regulation_clauses").  (Or, the annotations for the
> collection if that's what it actually is).
>
> ~~~
> Also, let's enable some extra logging.
>
> In WEB-INF/logging.properties, switch these two properties to DEBUG:
>
> # DataNucleus
> # the first two log the DML and DDL (if set to DEBUG)
> log4j.logger.DataNucleus.Datastore.Native=DEBUG, Console
> log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console
>
>
> Also, in persistor.properties, you could enable the log4jdbc-remix driver,
> eg, if using hsqldb then comment out:
>
>
> #isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
>
> #isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:mem:test
> #isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
> #isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
>
> and replace with (below):
>
>
> isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
>
> isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test
> isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
> isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=
>
>
> Hopefully in your console you'll be able to search for 'idx' and we'll get
> a clue what it relates to.
>
>
>
> Thx
> Dan
>
>
>
>
>
>
>
>
>
>
>
> On 6 March 2015 at 14:19, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
>> Thanks for replying so quickly!
>>
>> 'Idx' is not a field added by me, thus, it is created by Isis/DN, I think?
>> Some index-stuff for the database table?
>>
>> Best,
>> Marianne.
>>
>> -----Original Message-----
>> From: Martin Grigorov [mailto:mgrigorov@apache.org]
>> Sent: 6. mars 2015 15:10
>> To: users
>> Subject: Re: Not able to add 1:m bidirectional relationship
>>
>>  java.sql.SQLException: Field 'idx' doesn't have a default value
>>
>> Do you have an entity with field 'idx' in your model ?
>> Or it could be something created by Isis/DN, I don't know.
>>
>> Martin Grigorov
>> Wicket Training and Consulting
>> https://twitter.com/mtgrigorov
>>
>> On Fri, Mar 6, 2015 at 4:06 PM, Marianne Hagaseth <
>> Marianne.Hagaseth@marintek.sintef.no> wrote:
>>
>> > Yes, a lot. See below.
>> > It seems like the values are not picked up, and then the insert into
>> > the database tables fails because the columns are NOT NULL and no
>> > default values exists.
>> >
>> > Some more from the STACK:
>> >
>> > Caused by:
>> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>> >         ... 71 more
>> > Caused by: java.sql.SQLException: Field 'idx' doesn't have a default
>> > value
>> >
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> > And more:
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> >
>> >         ... 73 more
>> > Nested Throwables StackTrace:
>> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>> >         at
>> > org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSe
>> > tStore.java:754)
>> >
>> >         at
>> >
>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>> >         at
>> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
>> > va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a
>> > default value
>> >         at
>> > com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>> >
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>> >         ... 73 more
>> >
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> > And more:
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> >
>> > 14:45:38,105  [Persistence          1661257338@qtp-721005297-3 WARN ]
>> > Execution of method "add" on field "clauses" caused an error : Add
>> > request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
>> > (?,?) Add request failed : INSERT INTO regulation_clauses
>> > (id_oid,id_eid) VALUES
>> > (?,?)
>> > org.datanucleus.exceptions.NucleusDataStoreException: Add request
>> failed :
>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)
>> >         at
>> > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>> >
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> > And more:
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> >
>> >         at
>> >
>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>> >         at
>> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
>> > va:582)
>> > Caused by:
>> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>> >         ... 71 more
>> > Caused by: java.sql.SQLException: Field 'idx' doesn't have a default
>> value
>> >         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>> >         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
>> >
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> > And more:
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> >
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>> >         ... 73 more
>> > Nested Throwables StackTrace:
>> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>> >         at
>> >
>> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>> >         at
>> > org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetS
>> > tore.java:502)
>> >
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> > And more:
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> >
>> >         at
>> >
>> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>> >         at
>> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
>> > va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a
>> > default value
>> >         at
>> > com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>> >
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> > And more:
>> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
>> >
>> > Best
>> > -Marianne.
>> >
>> > -----Original Message-----
>> > From: Martin Grigorov [mailto:mgrigorov@apache.org]
>> > Sent: 6. mars 2015 14:53
>> > To: users
>> > Subject: Re: Not able to add 1:m bidirectional relationship
>> >
>> > Hi,
>> >
>> >
>> > On Fri, Mar 6, 2015 at 3:51 PM, Marianne Hagaseth <
>> > Marianne.Hagaseth@marintek.sintef.no> wrote:
>> >
>> > > Hi,
>> > > I am trying to add a 1:m bidirectional relationship, but it fails.
>> > > I wonder if  could be a mismatch between the versions used for some
>> > > of the stuff needed.
>> > > My set up looks like:
>> > >
>> > >
>> > > *        isis-core-webserver 1.7.0
>> > >
>> > > *        datanucleus-api-jdo-3.2.7
>> > >
>> > > *        Eclipse Java EE IDE 4.4.2
>> > >
>> > > *        mysql-connector-java-5.1.34
>> > >
>> > > *        mysql server 5.6.23
>> > >
>> > > *        Jdk 1.7.0_75
>> > >
>> > >
>> > > It fails here at backingStore.add(...):
>> > >
>> > >                 try
>> > >
>> > >                 {
>> > >
>> > >                     backingStore.add(ownerOP,element, (useCache ?
>> > > delegate.size() : -1));
>> > >
>> > >                 }
>> > >
>> > >                 catch (NucleusDataStoreException dse)
>> > >
>> > >                 {
>> > >
>> > >
>> > > NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013",
>> > > "add", ownerMmd.getName(), dse));
>> > >
>> > >                     backingSuccess = false;
>> > >
>> > >                 }
>> > > With Error message:
>> > >
>> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
>> > > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>> > >
>> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
>> > > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
>> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>> > >
>> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
>> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
>> > > VALUES
>> > > (?,?)
>> > >
>> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
>> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
>> > > VALUES
>> > > (?,?)
>> > >
>> > > 12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN ]
>> > > Execution of method "add" on field "clauses" caused an error : Add
>> > > request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
>> > > VALUES
>> > > (?,?)
>> > >
>> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
>> > > VALUES
>> > > (?,?)
>> > >
>> > > org.datanucleus.exceptions.NucleusDataStoreException: Add request
>> > > failed
>> > :
>> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>> > >
>> > >         at
>> > > org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.j
>> > > av
>> > > a:349)
>> > >
>> > >         at
>> > > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>> > >
>> > >         at dom.regulation.Regulation.addClause(Regulation.java:795)
>> > >
>> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> > > Method)
>> > >
>> > >         at
>> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
>> > > .j
>> > > ava:57)
>> > >
>> > >         at
>> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
>> > > ss
>> > > orImpl.java:43)
>> > >
>> > >
>> > > etc.etc...
>> > >
>> >
>> > Is there "Caused by: ..." down in the stack ?
>> >
>> >
>> > >
>> > > Best regards,
>> > > Marianne Hagaseth
>> > >
>> > >
>> >
>>
>
>

Re: Not able to add 1:m bidirectional relationship

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
Hi Marianne,

If "Idx" isn't a property that you've explicitly added, then it's probably
been added through some DN annotation that you have (is my guess).

So, could you show us the DN annotations for the entity that's mapped to
the failing table ("regulation_clauses").  (Or, the annotations for the
collection if that's what it actually is).

~~~
Also, let's enable some extra logging.

In WEB-INF/logging.properties, switch these two properties to DEBUG:

# DataNucleus
# the first two log the DML and DDL (if set to DEBUG)
log4j.logger.DataNucleus.Datastore.Native=DEBUG, Console
log4j.logger.DataNucleus.Datastore.Schema=DEBUG, Console


Also, in persistor.properties, you could enable the log4jdbc-remix driver,
eg, if using hsqldb then comment out:

#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:hsqldb:mem:test
#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
#isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=

and replace with (below):

isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:hsqldb:mem:test
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=


Hopefully in your console you'll be able to search for 'idx' and we'll get
a clue what it relates to.



Thx
Dan











On 6 March 2015 at 14:19, Marianne Hagaseth <
Marianne.Hagaseth@marintek.sintef.no> wrote:

> Thanks for replying so quickly!
>
> 'Idx' is not a field added by me, thus, it is created by Isis/DN, I think?
> Some index-stuff for the database table?
>
> Best,
> Marianne.
>
> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> Sent: 6. mars 2015 15:10
> To: users
> Subject: Re: Not able to add 1:m bidirectional relationship
>
>  java.sql.SQLException: Field 'idx' doesn't have a default value
>
> Do you have an entity with field 'idx' in your model ?
> Or it could be something created by Isis/DN, I don't know.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Fri, Mar 6, 2015 at 4:06 PM, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> > Yes, a lot. See below.
> > It seems like the values are not picked up, and then the insert into
> > the database tables fails because the columns are NOT NULL and no
> > default values exists.
> >
> > Some more from the STACK:
> >
> > Caused by:
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
> >         ... 71 more
> > Caused by: java.sql.SQLException: Field 'idx' doesn't have a default
> > value
> >
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> > And more:
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> >
> >         ... 73 more
> > Nested Throwables StackTrace:
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >         at
> > org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSe
> > tStore.java:754)
> >
> >         at
> >
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
> >         at
> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> > va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a
> > default value
> >         at
> > com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
> >
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
> >         ... 73 more
> >
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> > And more:
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> >
> > 14:45:38,105  [Persistence          1661257338@qtp-721005297-3 WARN ]
> > Execution of method "add" on field "clauses" caused an error : Add
> > request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
> > (?,?) Add request failed : INSERT INTO regulation_clauses
> > (id_oid,id_eid) VALUES
> > (?,?)
> > org.datanucleus.exceptions.NucleusDataStoreException: Add request failed
> :
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)
> >         at
> > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
> >
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> > And more:
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> >
> >         at
> >
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
> >         at
> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> > va:582)
> > Caused by:
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
> >         ... 71 more
> > Caused by: java.sql.SQLException: Field 'idx' doesn't have a default
> value
> >         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
> >         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
> >
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> > And more:
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> >
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
> >         ... 73 more
> > Nested Throwables StackTrace:
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >         at
> >
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
> >         at
> > org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetS
> > tore.java:502)
> >
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> > And more:
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> >
> >         at
> >
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
> >         at
> > org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> > va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a
> > default value
> >         at
> > com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
> >
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> > And more:
> > <<<<<<<<<<<<<<<<<<<<<<<<<<<
> >
> > Best
> > -Marianne.
> >
> > -----Original Message-----
> > From: Martin Grigorov [mailto:mgrigorov@apache.org]
> > Sent: 6. mars 2015 14:53
> > To: users
> > Subject: Re: Not able to add 1:m bidirectional relationship
> >
> > Hi,
> >
> >
> > On Fri, Mar 6, 2015 at 3:51 PM, Marianne Hagaseth <
> > Marianne.Hagaseth@marintek.sintef.no> wrote:
> >
> > > Hi,
> > > I am trying to add a 1:m bidirectional relationship, but it fails.
> > > I wonder if  could be a mismatch between the versions used for some
> > > of the stuff needed.
> > > My set up looks like:
> > >
> > >
> > > *        isis-core-webserver 1.7.0
> > >
> > > *        datanucleus-api-jdo-3.2.7
> > >
> > > *        Eclipse Java EE IDE 4.4.2
> > >
> > > *        mysql-connector-java-5.1.34
> > >
> > > *        mysql server 5.6.23
> > >
> > > *        Jdk 1.7.0_75
> > >
> > >
> > > It fails here at backingStore.add(...):
> > >
> > >                 try
> > >
> > >                 {
> > >
> > >                     backingStore.add(ownerOP,element, (useCache ?
> > > delegate.size() : -1));
> > >
> > >                 }
> > >
> > >                 catch (NucleusDataStoreException dse)
> > >
> > >                 {
> > >
> > >
> > > NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013",
> > > "add", ownerMmd.getName(), dse));
> > >
> > >                     backingSuccess = false;
> > >
> > >                 }
> > > With Error message:
> > >
> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> > >
> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> > >
> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
> > > VALUES
> > > (?,?)
> > >
> > > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
> > > VALUES
> > > (?,?)
> > >
> > > 12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN ]
> > > Execution of method "add" on field "clauses" caused an error : Add
> > > request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
> > > VALUES
> > > (?,?)
> > >
> > > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
> > > VALUES
> > > (?,?)
> > >
> > > org.datanucleus.exceptions.NucleusDataStoreException: Add request
> > > failed
> > :
> > > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> > >
> > >         at
> > > org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.j
> > > av
> > > a:349)
> > >
> > >         at
> > > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
> > >
> > >         at dom.regulation.Regulation.addClause(Regulation.java:795)
> > >
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > Method)
> > >
> > >         at
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
> > > .j
> > > ava:57)
> > >
> > >         at
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
> > > ss
> > > orImpl.java:43)
> > >
> > >
> > > etc.etc...
> > >
> >
> > Is there "Caused by: ..." down in the stack ?
> >
> >
> > >
> > > Best regards,
> > > Marianne Hagaseth
> > >
> > >
> >
>

FW: Not able to add 1:m bidirectional relationship

Posted by Marianne Hagaseth <Ma...@marintek.sintef.no>.
Thanks Martin,
you sent me in the right direction:
I had to drop the tables and the database, then things works OK when starting all over again with the creation of tables!

Thanks a lot!

Best,
Marianne.

-----Original Message-----
From: Marianne Hagaseth [mailto:Marianne.Hagaseth@marintek.sintef.no] 
Sent: 6. mars 2015 15:19
To: users@isis.apache.org
Subject: RE: Not able to add 1:m bidirectional relationship

Thanks for replying so quickly!

'Idx' is not a field added by me, thus, it is created by Isis/DN, I think?
Some index-stuff for the database table?

Best,
Marianne.

-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org]
Sent: 6. mars 2015 15:10
To: users
Subject: Re: Not able to add 1:m bidirectional relationship

 java.sql.SQLException: Field 'idx' doesn't have a default value

Do you have an entity with field 'idx' in your model ?
Or it could be something created by Isis/DN, I don't know.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Mar 6, 2015 at 4:06 PM, Marianne Hagaseth < Marianne.Hagaseth@marintek.sintef.no> wrote:

> Yes, a lot. See below.
> It seems like the values are not picked up, and then the insert into 
> the database tables fails because the columns are NOT NULL and no 
> default values exists.
>
> Some more from the STACK:
>
> Caused by:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>         ... 71 more
> Caused by: java.sql.SQLException: Field 'idx' doesn't have a default 
> value
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         ... 73 more
> Nested Throwables StackTrace:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSe
> tStore.java:754)
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a 
> default value
>         at
> com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>         ... 73 more
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> 14:45:38,105  [Persistence          1661257338@qtp-721005297-3 WARN ]
> Execution of method "add" on field "clauses" caused an error : Add 
> request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
> (?,?) Add request failed : INSERT INTO regulation_clauses
> (id_oid,id_eid) VALUES
> (?,?)
> org.datanucleus.exceptions.NucleusDataStoreException: Add request failed :
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)
>         at
> org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> va:582)
> Caused by:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>         ... 71 more
> Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>         ... 73 more
> Nested Throwables StackTrace:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetS
> tore.java:502)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a 
> default value
>         at
> com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> Best
> -Marianne.
>
> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> Sent: 6. mars 2015 14:53
> To: users
> Subject: Re: Not able to add 1:m bidirectional relationship
>
> Hi,
>
>
> On Fri, Mar 6, 2015 at 3:51 PM, Marianne Hagaseth < 
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> > Hi,
> > I am trying to add a 1:m bidirectional relationship, but it fails.
> > I wonder if  could be a mismatch between the versions used for some 
> > of the stuff needed.
> > My set up looks like:
> >
> >
> > *        isis-core-webserver 1.7.0
> >
> > *        datanucleus-api-jdo-3.2.7
> >
> > *        Eclipse Java EE IDE 4.4.2
> >
> > *        mysql-connector-java-5.1.34
> >
> > *        mysql server 5.6.23
> >
> > *        Jdk 1.7.0_75
> >
> >
> > It fails here at backingStore.add(...):
> >
> >                 try
> >
> >                 {
> >
> >                     backingStore.add(ownerOP,element, (useCache ?
> > delegate.size() : -1));
> >
> >                 }
> >
> >                 catch (NucleusDataStoreException dse)
> >
> >                 {
> >
> >
> > NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013",
> > "add", ownerMmd.getName(), dse));
> >
> >                     backingSuccess = false;
> >
> >                 }
> > With Error message:
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> > VALUES
> > (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> > VALUES
> > (?,?)
> >
> > 12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN ]
> > Execution of method "add" on field "clauses" caused an error : Add 
> > request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> > VALUES
> > (?,?)
> >
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> > VALUES
> > (?,?)
> >
> > org.datanucleus.exceptions.NucleusDataStoreException: Add request 
> > failed
> :
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> >         at
> > org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.j
> > av
> > a:349)
> >
> >         at
> > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
> >
> >         at dom.regulation.Regulation.addClause(Regulation.java:795)
> >
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >
> >         at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
> > .j
> > ava:57)
> >
> >         at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
> > ss
> > orImpl.java:43)
> >
> >
> > etc.etc...
> >
>
> Is there "Caused by: ..." down in the stack ?
>
>
> >
> > Best regards,
> > Marianne Hagaseth
> >
> >
>

AW: ActionLayout/cssClass

Posted by "Rade, Joerg / Kuehne + Nagel / Ham GI-PS" <Jo...@Kuehne-Nagel.com>.
>I think you need to use "btn-danger" [1]

That works.

>Also, you might want to explore using the .layout.json files, since will reload dynamically, avoiding restart.

Currently compile and run times are OK but I'll look into it.

Thanks Dan!
-j




Kühne + Nagel (AG & Co.) KG
Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE 812773878.
Geschäftsleitung Kühne + Nagel (AG & Co.) KG: Reiner Heiken (Vors.), Dirk Blesius, Martin Brinkmann, Holger Ketz, Jan-Hendrik Köstergarten, Christian Solf, Lars Wedel, Jens Wollesen.
Persönlich haftende Gesellschafterin: Kühne & Nagel A.G., Rechtsform: Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745, Geschäftsführendes Verwaltungsratsmitglied: Karl Gernandt.
Geschäftsleitung Region Westeuropa: Yngve Ruud (Vors.), Hans-Georg Brinkmann (Stellv.), Richard Huhn, Björn Johansson, Jan Kunze, Bruno Mang, Stefan Paul, Tim Scharwath, Dominic Edmonds.

Wir arbeiten ausschließlich auf Grundlage der Allgemeinen Deutschen Spediteursbedingungen (ADSp), jeweils neuester Fassung. Wir verweisen insbesondere auf die vom Gesetz abweichenden Haftungsbeschränkungen von Ziffer 23 und 24 ADSp. Den vollständigen Text der ADSp übersenden wir Ihnen gerne auf Anfrage und können Sie auch unter http://www.kuehne-nagel.com einsehen. Ergänzend wird vereinbart, dass (1) Ziffer 27 ADSp im Rahmen internationaler Übereinkommen weder unsere Haftung noch die Zurechnung des Verschuldens von Leuten und sonstigen Dritten zu Gunsten des Auftraggebers erweitert, und (2) wir in den im deutschen Seehandelsrecht aufgeführten Fällen des nautischen Verschuldens oder Feuer an Bord nur für eigenes Verschulden und (3) im Sinne der CMNI genannten Voraussetzungen nicht für nautisches Verschulden, Feuer an Bord oder Mängel des Schiffes haften.

Re: ActionLayout/cssClass

Posted by Dan Haywood <da...@haywood-associates.co.uk>.
I think you need to use "btn-danger" [1]

Also, you might want to explore using the .layout.json files, since will
reload dynamically, avoiding restart.

[1] http://getbootstrap.com/css/#buttons-options

2015-03-06 14:31 GMT+00:00 Rade, Joerg / Kuehne + Nagel / Ham GI-PS <
Joerg.Rade@kuehne-nagel.com>:

> Hi,
>
> I use
>
> @ActionLayout(
>             contributed = Contributed.AS_ACTION,
>             named = "Check Endpoints",
>             describedAs = "Check if WS endpoints and JMS topics exist for
> release",
>             cssClass = "x-caution",
>             cssClassFa = "bolt")
>
> and expected the action button to be red. Instead it is grey.
>
> I'm using 1.8.0 and remember it was colored in previous versions.
>
> Am I missing something?
>
> Thanks in advance
> Jörg
>
> Kühne + Nagel (AG & Co.) KG
> Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE
> 812773878.
> Geschäftsleitung Kühne + Nagel (AG & Co.) KG: Reiner Heiken (Vors.), Dirk
> Blesius, Martin Brinkmann, Holger Ketz, Jan-Hendrik Köstergarten, Christian
> Solf, Lars Wedel, Jens Wollesen.
> Persönlich haftende Gesellschafterin: Kühne & Nagel A.G., Rechtsform:
> Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745,
> Geschäftsführendes Verwaltungsratsmitglied: Karl Gernandt.
> Geschäftsleitung Region Westeuropa: Yngve Ruud (Vors.), Hans-Georg
> Brinkmann (Stellv.), Richard Huhn, Björn Johansson, Jan Kunze, Bruno Mang,
> Stefan Paul, Tim Scharwath, Dominic Edmonds.
>
> Wir arbeiten ausschließlich auf Grundlage der Allgemeinen Deutschen
> Spediteursbedingungen (ADSp), jeweils neuester Fassung. Wir verweisen
> insbesondere auf die vom Gesetz abweichenden Haftungsbeschränkungen von
> Ziffer 23 und 24 ADSp. Den vollständigen Text der ADSp übersenden wir Ihnen
> gerne auf Anfrage und können Sie auch unter http://www.kuehne-nagel.com
> einsehen. Ergänzend wird vereinbart, dass (1) Ziffer 27 ADSp im Rahmen
> internationaler Übereinkommen weder unsere Haftung noch die Zurechnung des
> Verschuldens von Leuten und sonstigen Dritten zu Gunsten des Auftraggebers
> erweitert, und (2) wir in den im deutschen Seehandelsrecht aufgeführten
> Fällen des nautischen Verschuldens oder Feuer an Bord nur für eigenes
> Verschulden und (3) im Sinne der CMNI genannten Voraussetzungen nicht für
> nautisches Verschulden, Feuer an Bord oder Mängel des Schiffes haften.
>

ActionLayout/cssClass

Posted by "Rade, Joerg / Kuehne + Nagel / Ham GI-PS" <Jo...@Kuehne-Nagel.com>.
Hi,

I use

@ActionLayout(
            contributed = Contributed.AS_ACTION,
            named = "Check Endpoints",
            describedAs = "Check if WS endpoints and JMS topics exist for release",
            cssClass = "x-caution",
            cssClassFa = "bolt")

and expected the action button to be red. Instead it is grey.

I'm using 1.8.0 and remember it was colored in previous versions.

Am I missing something?

Thanks in advance
Jörg

Kühne + Nagel (AG & Co.) KG
Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE 812773878.
Geschäftsleitung Kühne + Nagel (AG & Co.) KG: Reiner Heiken (Vors.), Dirk Blesius, Martin Brinkmann, Holger Ketz, Jan-Hendrik Köstergarten, Christian Solf, Lars Wedel, Jens Wollesen.
Persönlich haftende Gesellschafterin: Kühne & Nagel A.G., Rechtsform: Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745, Geschäftsführendes Verwaltungsratsmitglied: Karl Gernandt.
Geschäftsleitung Region Westeuropa: Yngve Ruud (Vors.), Hans-Georg Brinkmann (Stellv.), Richard Huhn, Björn Johansson, Jan Kunze, Bruno Mang, Stefan Paul, Tim Scharwath, Dominic Edmonds.

Wir arbeiten ausschließlich auf Grundlage der Allgemeinen Deutschen Spediteursbedingungen (ADSp), jeweils neuester Fassung. Wir verweisen insbesondere auf die vom Gesetz abweichenden Haftungsbeschränkungen von Ziffer 23 und 24 ADSp. Den vollständigen Text der ADSp übersenden wir Ihnen gerne auf Anfrage und können Sie auch unter http://www.kuehne-nagel.com einsehen. Ergänzend wird vereinbart, dass (1) Ziffer 27 ADSp im Rahmen internationaler Übereinkommen weder unsere Haftung noch die Zurechnung des Verschuldens von Leuten und sonstigen Dritten zu Gunsten des Auftraggebers erweitert, und (2) wir in den im deutschen Seehandelsrecht aufgeführten Fällen des nautischen Verschuldens oder Feuer an Bord nur für eigenes Verschulden und (3) im Sinne der CMNI genannten Voraussetzungen nicht für nautisches Verschulden, Feuer an Bord oder Mängel des Schiffes haften.

RE: Not able to add 1:m bidirectional relationship

Posted by Marianne Hagaseth <Ma...@marintek.sintef.no>.
Thanks for replying so quickly!

'Idx' is not a field added by me, thus, it is created by Isis/DN, I think?
Some index-stuff for the database table?

Best,
Marianne.

-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org] 
Sent: 6. mars 2015 15:10
To: users
Subject: Re: Not able to add 1:m bidirectional relationship

 java.sql.SQLException: Field 'idx' doesn't have a default value

Do you have an entity with field 'idx' in your model ?
Or it could be something created by Isis/DN, I don't know.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Mar 6, 2015 at 4:06 PM, Marianne Hagaseth < Marianne.Hagaseth@marintek.sintef.no> wrote:

> Yes, a lot. See below.
> It seems like the values are not picked up, and then the insert into 
> the database tables fails because the columns are NOT NULL and no 
> default values exists.
>
> Some more from the STACK:
>
> Caused by:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>         ... 71 more
> Caused by: java.sql.SQLException: Field 'idx' doesn't have a default 
> value
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         ... 73 more
> Nested Throwables StackTrace:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSe
> tStore.java:754)
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a 
> default value
>         at 
> com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>         ... 73 more
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> 14:45:38,105  [Persistence          1661257338@qtp-721005297-3 WARN ]
> Execution of method "add" on field "clauses" caused an error : Add 
> request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES 
> (?,?) Add request failed : INSERT INTO regulation_clauses 
> (id_oid,id_eid) VALUES
> (?,?)
> org.datanucleus.exceptions.NucleusDataStoreException: Add request failed :
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)
>         at
> org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> va:582)
> Caused by:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>         ... 71 more
> Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>         ... 73 more
> Nested Throwables StackTrace:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetS
> tore.java:502)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.ja
> va:582) Caused by: java.sql.SQLException: Field 'idx' doesn't have a 
> default value
>         at 
> com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> Best
> -Marianne.
>
> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> Sent: 6. mars 2015 14:53
> To: users
> Subject: Re: Not able to add 1:m bidirectional relationship
>
> Hi,
>
>
> On Fri, Mar 6, 2015 at 3:51 PM, Marianne Hagaseth < 
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> > Hi,
> > I am trying to add a 1:m bidirectional relationship, but it fails.
> > I wonder if  could be a mismatch between the versions used for some 
> > of the stuff needed.
> > My set up looks like:
> >
> >
> > *        isis-core-webserver 1.7.0
> >
> > *        datanucleus-api-jdo-3.2.7
> >
> > *        Eclipse Java EE IDE 4.4.2
> >
> > *        mysql-connector-java-5.1.34
> >
> > *        mysql server 5.6.23
> >
> > *        Jdk 1.7.0_75
> >
> >
> > It fails here at backingStore.add(...):
> >
> >                 try
> >
> >                 {
> >
> >                     backingStore.add(ownerOP,element, (useCache ?
> > delegate.size() : -1));
> >
> >                 }
> >
> >                 catch (NucleusDataStoreException dse)
> >
> >                 {
> >
> >
> > NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013",
> > "add", ownerMmd.getName(), dse));
> >
> >                     backingSuccess = false;
> >
> >                 }
> > With Error message:
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> > VALUES
> > (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> > VALUES
> > (?,?)
> >
> > 12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN ]
> > Execution of method "add" on field "clauses" caused an error : Add 
> > request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> > VALUES
> > (?,?)
> >
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> > VALUES
> > (?,?)
> >
> > org.datanucleus.exceptions.NucleusDataStoreException: Add request 
> > failed
> :
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> >         at
> > org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.j
> > av
> > a:349)
> >
> >         at
> > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
> >
> >         at dom.regulation.Regulation.addClause(Regulation.java:795)
> >
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
> > Method)
> >
> >         at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
> > .j
> > ava:57)
> >
> >         at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
> > ss
> > orImpl.java:43)
> >
> >
> > etc.etc...
> >
>
> Is there "Caused by: ..." down in the stack ?
>
>
> >
> > Best regards,
> > Marianne Hagaseth
> >
> >
>

Re: Not able to add 1:m bidirectional relationship

Posted by Martin Grigorov <mg...@apache.org>.
 java.sql.SQLException: Field 'idx' doesn't have a default value

Do you have an entity with field 'idx' in your model ?
Or it could be something created by Isis/DN, I don't know.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Mar 6, 2015 at 4:06 PM, Marianne Hagaseth <
Marianne.Hagaseth@marintek.sintef.no> wrote:

> Yes, a lot. See below.
> It seems like the values are not picked up, and then the insert into the
> database tables fails because the columns are NOT NULL and no default
> values exists.
>
> Some more from the STACK:
>
> Caused by:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT
> INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>         ... 71 more
> Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         ... 73 more
> Nested Throwables StackTrace:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT
> INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>         ... 73 more
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> 14:45:38,105  [Persistence          1661257338@qtp-721005297-3 WARN ]
> Execution of method "add" on field "clauses" caused an error : Add request
> failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
> (?,?)
> org.datanucleus.exceptions.NucleusDataStoreException: Add request failed :
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)
>         at
> org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Caused by:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT
> INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
>         ... 71 more
> Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
>         ... 73 more
> Nested Throwables StackTrace:
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT
> INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>         at
> org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
>         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
> And more:
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> Best
> -Marianne.
>
> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigorov@apache.org]
> Sent: 6. mars 2015 14:53
> To: users
> Subject: Re: Not able to add 1:m bidirectional relationship
>
> Hi,
>
>
> On Fri, Mar 6, 2015 at 3:51 PM, Marianne Hagaseth <
> Marianne.Hagaseth@marintek.sintef.no> wrote:
>
> > Hi,
> > I am trying to add a 1:m bidirectional relationship, but it fails.
> > I wonder if  could be a mismatch between the versions used for some of
> > the stuff needed.
> > My set up looks like:
> >
> >
> > *        isis-core-webserver 1.7.0
> >
> > *        datanucleus-api-jdo-3.2.7
> >
> > *        Eclipse Java EE IDE 4.4.2
> >
> > *        mysql-connector-java-5.1.34
> >
> > *        mysql server 5.6.23
> >
> > *        Jdk 1.7.0_75
> >
> >
> > It fails here at backingStore.add(...):
> >
> >                 try
> >
> >                 {
> >
> >                     backingStore.add(ownerOP,element, (useCache ?
> > delegate.size() : -1));
> >
> >                 }
> >
> >                 catch (NucleusDataStoreException dse)
> >
> >                 {
> >
> >
> > NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013",
> > "add", ownerMmd.getName(), dse));
> >
> >                     backingSuccess = false;
> >
> >                 }
> > With Error message:
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > org.datanucleus.store.rdbms.exceptions.MappedDatastoreException:
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
> > VALUES
> > (?,?)
> >
> > 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
> > VALUES
> > (?,?)
> >
> > 12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN ]
> > Execution of method "add" on field "clauses" caused an error : Add
> > request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
> > (?,?)
> >
> > Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid)
> > VALUES
> > (?,?)
> >
> > org.datanucleus.exceptions.NucleusDataStoreException: Add request failed
> :
> > INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
> >
> >         at
> > org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.jav
> > a:349)
> >
> >         at
> > org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
> >
> >         at dom.regulation.Regulation.addClause(Regulation.java:795)
> >
> >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >
> >         at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> > ava:57)
> >
> >         at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> > orImpl.java:43)
> >
> >
> > etc.etc...
> >
>
> Is there "Caused by: ..." down in the stack ?
>
>
> >
> > Best regards,
> > Marianne Hagaseth
> >
> >
>

RE: Not able to add 1:m bidirectional relationship

Posted by Marianne Hagaseth <Ma...@marintek.sintef.no>.
Yes, a lot. See below.
It seems like the values are not picked up, and then the insert into the database tables fails because the columns are NOT NULL and no default values exists.

Some more from the STACK:

Caused by: org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?) 
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
	... 71 more
Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value

<<<<<<<<<<<<<<<<<<<<<<<<<<<
And more:
<<<<<<<<<<<<<<<<<<<<<<<<<<<

	... 73 more
Nested Throwables StackTrace:
org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?) 
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)

	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)

	at org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
	... 73 more

<<<<<<<<<<<<<<<<<<<<<<<<<<<
And more:
<<<<<<<<<<<<<<<<<<<<<<<<<<<

14:45:38,105  [Persistence          1661257338@qtp-721005297-3 WARN ]  Execution of method "add" on field "clauses" caused an error : Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?) 
Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?) 
org.datanucleus.exceptions.NucleusDataStoreException: Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?) 
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)
	at org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)

<<<<<<<<<<<<<<<<<<<<<<<<<<<
And more:
<<<<<<<<<<<<<<<<<<<<<<<<<<<

	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?) 
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:333)
	... 71 more
Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)

<<<<<<<<<<<<<<<<<<<<<<<<<<<
And more:
<<<<<<<<<<<<<<<<<<<<<<<<<<<

	at org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:733)
	... 73 more
Nested Throwables StackTrace:
org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?) 
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.doInternalAdd(JoinSetStore.java:754)
	at org.datanucleus.store.rdbms.scostore.JoinSetStore.internalAdd(JoinSetStore.java:502)

<<<<<<<<<<<<<<<<<<<<<<<<<<<
And more:
<<<<<<<<<<<<<<<<<<<<<<<<<<<

	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.sql.SQLException: Field 'idx' doesn't have a default value
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)

<<<<<<<<<<<<<<<<<<<<<<<<<<<
And more:
<<<<<<<<<<<<<<<<<<<<<<<<<<<

Best
-Marianne.

-----Original Message-----
From: Martin Grigorov [mailto:mgrigorov@apache.org] 
Sent: 6. mars 2015 14:53
To: users
Subject: Re: Not able to add 1:m bidirectional relationship

Hi,


On Fri, Mar 6, 2015 at 3:51 PM, Marianne Hagaseth < Marianne.Hagaseth@marintek.sintef.no> wrote:

> Hi,
> I am trying to add a 1:m bidirectional relationship, but it fails.
> I wonder if  could be a mismatch between the versions used for some of 
> the stuff needed.
> My set up looks like:
>
>
> *        isis-core-webserver 1.7.0
>
> *        datanucleus-api-jdo-3.2.7
>
> *        Eclipse Java EE IDE 4.4.2
>
> *        mysql-connector-java-5.1.34
>
> *        mysql server 5.6.23
>
> *        Jdk 1.7.0_75
>
>
> It fails here at backingStore.add(...):
>
>                 try
>
>                 {
>
>                     backingStore.add(ownerOP,element, (useCache ?
> delegate.size() : -1));
>
>                 }
>
>                 catch (NucleusDataStoreException dse)
>
>                 {
>
>                     
> NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013",
> "add", ownerMmd.getName(), dse));
>
>                     backingSuccess = false;
>
>                 }
> With Error message:
>
> 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>
> 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: 
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>
> 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> VALUES
> (?,?)
>
> 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> VALUES
> (?,?)
>
> 12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN ]
> Execution of method "add" on field "clauses" caused an error : Add 
> request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES 
> (?,?)
>
> Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) 
> VALUES
> (?,?)
>
> org.datanucleus.exceptions.NucleusDataStoreException: Add request failed :
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.jav
> a:349)
>
>         at
> org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>
>         at dom.regulation.Regulation.addClause(Regulation.java:795)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:57)
>
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.java:43)
>
>
> etc.etc...
>

Is there "Caused by: ..." down in the stack ?


>
> Best regards,
> Marianne Hagaseth
>
>

Re: Not able to add 1:m bidirectional relationship

Posted by Martin Grigorov <mg...@apache.org>.
Hi,


On Fri, Mar 6, 2015 at 3:51 PM, Marianne Hagaseth <
Marianne.Hagaseth@marintek.sintef.no> wrote:

> Hi,
> I am trying to add a 1:m bidirectional relationship, but it fails.
> I wonder if  could be a mismatch between the versions used for some of the
> stuff needed.
> My set up looks like:
>
>
> *        isis-core-webserver 1.7.0
>
> *        datanucleus-api-jdo-3.2.7
>
> *        Eclipse Java EE IDE 4.4.2
>
> *        mysql-connector-java-5.1.34
>
> *        mysql server 5.6.23
>
> *        Jdk 1.7.0_75
>
>
> It fails here at backingStore.add(...):
>
>                 try
>
>                 {
>
>                     backingStore.add(ownerOP,element, (useCache ?
> delegate.size() : -1));
>
>                 }
>
>                 catch (NucleusDataStoreException dse)
>
>                 {
>
>                     NucleusLogger.PERSISTENCE.warn(LOCALISER.msg("023013",
> "add", ownerMmd.getName(), dse));
>
>                     backingSuccess = false;
>
>                 }
> With Error message:
>
> 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT
> INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>
> 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> org.datanucleus.store.rdbms.exceptions.MappedDatastoreException: INSERT
> INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>
> 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
> (?,?)
>
> 12:20:54,055  [Datastore            1844639495@qtp-721005297-3 ERROR]
> Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
> (?,?)
>
> 12:20:54,056  [Persistence          1844639495@qtp-721005297-3 WARN ]
> Execution of method "add" on field "clauses" caused an error : Add request
> failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>
> Add request failed : INSERT INTO regulation_clauses (id_oid,id_eid) VALUES
> (?,?)
>
> org.datanucleus.exceptions.NucleusDataStoreException: Add request failed :
> INSERT INTO regulation_clauses (id_oid,id_eid) VALUES (?,?)
>
>         at
> org.datanucleus.store.rdbms.scostore.JoinSetStore.add(JoinSetStore.java:349)
>
>         at
> org.datanucleus.store.types.backed.SortedSet.add(SortedSet.java:716)
>
>         at dom.regulation.Regulation.addClause(Regulation.java:795)
>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
>
> etc.etc...
>

Is there "Caused by: ..." down in the stack ?


>
> Best regards,
> Marianne Hagaseth
>
>