You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Nadir T." <na...@yahoo.com.br> on 2003/12/19 13:22:10 UTC

Help with DListImpl_2

Hye,

    I have a problem upgrading from OJB 1.0 Rc3 to 1.0 Rc5, when I change DListImpl to DListImpl_2 in OJB.properties file I get the following error when executing queries to objects having lists of other objects (1-N relations):

SQLException during the execution of the insert (for a org.apache.ojb.odmg.collections.DListEntry_2): General error, message from server: "Column 'DLIST_ID' cannot be null"

java.sql.SQLException: General error, message from server: "Column 'DLIST_ID' cannot be null"

P.S.: DListImpl works fine.

Can anyone help me?

Thanks,

Nadir



---------------------------------
Central anti-spam do Yahoo! Mail: com dicas, dúvidas e curiosidades!

Help with DListImpl_2 (detailed explanation of the problem)

Posted by "Nadir T." <na...@yahoo.com.br>.
Thanks Armin for your quick answer, 
here's my configuration
  
File OJB.properties:

OqlCollectionClass=org.apache.ojb.odmg.collections.DListImpl_2
DListClass=org.apache.ojb.odmg.collections.DListImpl_2
DArrayClass=org.apache.ojb.odmg.collections.DListImpl_2

 

Here is the repository mapping:

<class-descriptor
class="Dominio.ExecutionYear"
table="EXECUTION_YEAR"
>

<field-descriptor 
name="idInternal"
column="ID_INTERNAL"
jdbc-type="INTEGER"
primarykey="true"
autoincrement="true"

/>

<field-descriptor 
name="year"
column="YEAR"
jdbc-type="VARCHAR"

/> 

<field-descriptor
name="state"
column="STATE"
conversion="ServidorPersistente.Conversores.JavaPeriodState2SqlPeriodState"
jdbc-type="VARCHAR"/> 

<field-descriptor
name="beginDate"
column="BEGIN_DATE"
jdbc-type="DATE"
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion"

/>

<field-descriptor
name="endDate"
column="END_DATE"
jdbc-type="DATE"
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlDateFieldConversion"
/> 

</class-descriptor>

After investigating a litle more I discovered that this only happens when I use OQL queries, specially involving Lists. Here's a code fragment of what I use (this code runs inside a ODMG transaction) :

String oqlQuery = "select all from " + ExecutionYear.class.getName() + " order by year desc";

query.create(oqlQuery);

Collection result = (Collection) query.execute();

lockRead((List) result);

ArrayList test = new ArrayList();

test.addAll(result);

The error mentioned in the previous mail, only happens when I commit
the transaction.
The same query using the Criteria API works fine.
I hope this explanation helps, otherwise I can send you the files, so you can have a look.


Thanks,
Nadir

 

Armin Waibel <ar...@code-au-lait.de> wrote:
Hi Nadir,

DListImpl_2 will become the replacement of 'old' DListImpl (DListImpl 
will be removed sooner or later). DListImpl_2 pass all test cases, so 
it's important to see what you are doing.
Can you send me a test by extending one of the test cases in the ojb 
test suite odmg-package, or a detailed description what you are doing
(with pseudo code).

regards,
Armin

Nadir T. wrote:
> Hye,
> 
> I have a problem upgrading from OJB 1.0 Rc3 to 1.0 Rc5, when I change DListImpl to DListImpl_2 in OJB.properties file I get the following error when executing queries to objects having lists of other objects (1-N relations):
> 
> SQLException during the execution of the insert (for a org.apache.ojb.odmg.collections.DListEntry_2): General error, message from server: "Column 'DLIST_ID' cannot be null"
> 
> java.sql.SQLException: General error, message from server: "Column 'DLIST_ID' cannot be null"
> 
> P.S.: DListImpl works fine.
> 
> Can anyone help me?
> 
> Thanks,
> 
> Nadir
> 
> 
> 
> ---------------------------------
> Central anti-spam do Yahoo! Mail: com dicas, dúvidas e curiosidades!

 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org




---------------------------------
Central anti-spam do Yahoo! Mail: com dicas, dúvidas e curiosidades!

Re: Help with DListImpl_2

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Nadir,

DListImpl_2 will become the replacement of 'old' DListImpl (DListImpl 
will be removed sooner or later). DListImpl_2 pass all test cases, so 
it's important to see what you are doing.
Can you send me a test by extending one of the test cases in the ojb 
test suite odmg-package, or a detailed description what you are doing
(with pseudo code).

regards,
Armin

Nadir T. wrote:
> Hye,
> 
>     I have a problem upgrading from OJB 1.0 Rc3 to 1.0 Rc5, when I change DListImpl to DListImpl_2 in OJB.properties file I get the following error when executing queries to objects having lists of other objects (1-N relations):
> 
> SQLException during the execution of the insert (for a org.apache.ojb.odmg.collections.DListEntry_2): General error, message from server: "Column 'DLIST_ID' cannot be null"
> 
> java.sql.SQLException: General error, message from server: "Column 'DLIST_ID' cannot be null"
> 
> P.S.: DListImpl works fine.
> 
> Can anyone help me?
> 
> Thanks,
> 
> Nadir
> 
> 
> 
> ---------------------------------
> Central anti-spam do Yahoo! Mail: com dicas, dúvidas e curiosidades!



---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org