Ok. It makes sense.
But in this case, it depends on how jBoss recycle out-of-space object.

It would be the containers or the integration code's responsibility to make
Castor aware of the object returned by pm.findByPrimaryKey(),
if what is returned is not come from Castor in the same transaction.



Thomas

-----Original Message-----
>From: Jacek Kruszelnicki [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, November 21, 2001 1:39 PM
>To: [EMAIL PROTECTED]
>Subject: Re: [castor-dev] Castor behaves differently within JBoss
>
>I meant : old object = exists in the database
>
>Here is the code snippet from my other post from a few minutes ago...
>I only get exception (about duplicate objects) when trying to commit, not
>sooner
>(with autostore = true)
>
>try {
>t = new Test(70);
>// company id=30 already exists in the DB, we just want to fetch it for
>reference
>Company co = (Company) pm.findByPrimaryKey(test.Company.class, new
>Integer(30));
>t.setOwnerCompany(co);
>System.out.println("Co ++ " + co);
>System.out.println("test " + t);
>pm.create(t);
>}
>catch (Exception ex) {
>
>
>
>-- Jacek
>
>
>At 12:50 PM 11/21/2001 -0800, you wrote:
>>See inline.
>>
>>
>>
>>-----Original Message-----
>> >From: Jacek Kruszelnicki [mailto:[EMAIL PROTECTED]]
>> >Sent: Thursday, 22 November 2001 9:14 a.m.
>> >To: [EMAIL PROTECTED]
>> >Subject: Re: [castor-dev] Castor behaves differently within JBoss
>> >
>> >
>> >OK, for now I set autostore to false in the MBean configuration.
>> >So I can now create a new object and refer it to an existing object -
ONLY
>>
>>The old object is not an existing object in the Castor world. It is only
>>something outside the atmosphere.
>>It is a mis-use. You should load the object again via Castor.
>>Or, use long transaction update to made Castor aware of the out-of-space
>>object.
>>
>>
>>
>>Thomas
>>
>>-----------------------------------------------------------
>>If you wish to unsubscribe from this mailing, send mail to
>>[EMAIL PROTECTED] with a subject of:
>>         unsubscribe castor-dev
>
>Jacek Kruszelnicki
>Numatica Corporation
>E-mail: [EMAIL PROTECTED]
>Phone: (781) 756 8064
>
>-----------------------------------------------------------
>If you wish to unsubscribe from this mailing, send mail to
>[EMAIL PROTECTED] with a subject of:
>        unsubscribe castor-dev
>

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to