I didn't realize that OJB supported primitive types, regardless I still get
this when the "id" is a non-zero value.  I've updated to RC6 and I'll play
with things and see if I can find a way to get it repeat.

--mikej
-=-----
mike jackson
[EMAIL PROTECTED]


-----Original Message-----
From: Danilo Tommasina [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 01, 2004 1:32 AM
To: OJB Users List
Subject: Re: Odd behavior


Hi,

never use 0 as primary key, it is causing problems. 0 is interpreted as 
null (beacause of support for primitive types). I don't know if the 
problem has been fixed in RC6. There are a couple of thread and posts 
about this, just search the archives.

cheers
Danilo

> I'm getting a strange behavior with OJB.  I'm running RC5 and I have a 
> table with an artificial primary key (OJB handles the generation of 
> the key and uses a SequenceManagerNextValImpl to do so).  I'm doing 
> something like this:
> 
>       User user = new User();
>       user.setUserId( new Integer( 0 ) );
>       QueryByCriteria query = new QueryByCriteria( user );
>       user = ( User ) broker.getObjectByQuery(query);
>       
> Where "User" is the object which maps to the user table configured in 
> OJB. I don't get any errors or anything and the object comes back 
> fully populated.  But the user id changes.  Generally on the first run 
> I get back user id = 0.  On the second run it's user id = 1, then 2, 
> then 3, etc.  For the life of me I can't figure out what's going on.  
> I had thought that perhaps it was picking up the next value from the 
> sequence, but when I restart the application it resets back to 0 and 
> then increments from there. I'm going to try updating to RC6, but does 
> anyone have any ideas otherwise?
> 
> --mikej
> -=-----
> mike jackson
> [EMAIL PROTECTED]
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-- 
Danilo Tommasina, Dipl. Ing. FH Telecom
Software Engineer
RCS Riskmanagement Concepts Systems AG
Technoparkstrasse 1
CH-8005 Zuerich
T: +41 1 445 29 08
[EMAIL PROTECTED]
www.risksys.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to