no, i didn't try long pk's. but could this really cause my problem? if so,
i'd fix it on my own. and i don't get a stack trace, because everything
seems to work fine. the real problem is, that my objects are multiple times
in the database table, because after the first store, the oid isn't set.





Hi again

[EMAIL PROTECTED] wrote:
> this is my oid mapping. i hope you mean this. in every table / object, i
> have one primary key field (oid) with parameters primarykey and
> autoincrement set true
>
>       <field-descriptor id="1"
>           name="oid"
>           column="oid"
>           jdbc-type="VARCHAR"
>           primarykey="true"
>           autoincrement="true"/>
>

This should be sufficient!
Please post your stacktrace.

Did your try to work with long instead of String for your primary keys?


cheers,
Thomas


>
>
>
>
>

>                     Thomas Mahler

>                     <thma@apache.        An:     OJB Users List
<[EMAIL PROTECTED]>
>                     org>                 Kopie:

>                                          Thema:  Re: problem with newly
created objects
>                     23.09.2002

>                     15:34

>                     Bitte

>                     antworten an

>                     "OJB Users

>                     List"

>

>

>
>
>
> OJB can only provide autoincrmeneted PK values if there is at leat one
> field declared as primary key *and* as autoincremented. Please refer to
> the tutorials for details.
>
> This is unit tested functionality !
>
> [EMAIL PROTECTED] wrote:
>
>>hi!
>>when i create a new object and store it, the object doesn't contain the
>
> new
>
>>oid after storing. this causes the problem, that after a second store,
>
> the
>
>>object will be stored again and exists with 2 different oids in the
>>database. i tried to overwrite
>>
>>private void writeObject(java.io.ObjectOutputStream out) throws
>
> IOException
>
>>in my persistent superclass and call
>>if (oid == null)
>>{
>>    new Identity(this);
>>}
>>
>>this causes serious troubles in PersistenceBrokerImpl (npe's).
>>
>>is there a default strategy to get the oid filled. shouldn't this be done
>>by ojb (i use the PersistenceBroker API, no ODMG).
>>
>>i'm using ojb 0.9.5
>>
>>
>>Juergen
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]
>>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>>
>>
>>
>>
>>
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]
>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>
>
>
>
>
>
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]
>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>
>
>
>
>



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






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

Reply via email to