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 Thomas Dudziak <to...@first.gmd.de> on 2003/07/30 16:33:01 UTC

auto-* settings and ODMG

Hi,

could please somebody explain why the auto- settings (auto-retrieve,
auto-delete, auto-update) should only be used with the default settings
when using ODMG (or JDO) ?

To give an example, how would I implement a composition (object of type A
"owns" n objects of type B -> collection) which naturally (at least I
think) use auto-delete and perhaps auto-update, for the ODMG
implementation ?

Thanks,
Tom



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


Re: IllegalStateException in DelegatingPersistenceBroker.getBroker

Posted by Thomas Dudziak <to...@first.fhg.de>.
Armin Waibel wrote:

>Hi Tom,
>
>do all odmg junit tests pass?
>Now OJB is more strict in handling PB instances.
>If PB.close() was called on a given instance no further
>method calls can be done. Your sample
>code seems ok, thus it sounds like a bug.
>  
>

Well, yes the tests pass (with hsqldb that is), sort of (see my other 
mail from yesterday). But I'll check whether I can reproduce it in a test.

Tom



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


Re: IllegalStateException in DelegatingPersistenceBroker.getBroker

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

do all odmg junit tests pass?
Now OJB is more strict in handling PB instances.
If PB.close() was called on a given instance no further
method calls can be done. Your sample
code seems ok, thus it sounds like a bug.

regards,
Armin

----- Original Message -----
From: "Thomas Dudziak" <to...@first.gmd.de>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Monday, August 04, 2003 3:27 PM
Subject: IllegalStateException in DelegatingPersistenceBroker.getBroker


> While doing a OMDG query like this (after some other committed
> transactions):
>
> OQLQuery queryObj = _odmg.newOQLQuery();
> String   query    = ... // some basic select
>
> _tx.begin();
> queryObj.create(query);
> DList result = (DList)queryObj.execute();
> _tx.commit();
>
> I get an IllegalStateException thrown in
> DelegatingPersistenceBroker.getBroker() while the query executes. When
> debugging I can see that in the execute method the collection is
correctly
> retrieved but the following locking (performLockingIfRequired)
seemingly
> tries to use an already closed broker.
> Any idea what might cause this ?
>
> BTW, I use the CVS version from August 1st with MySQL.
>
> Thanks,
> Tom
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>
>
>



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


IllegalStateException in DelegatingPersistenceBroker.getBroker

Posted by Thomas Dudziak <to...@first.gmd.de>.
While doing a OMDG query like this (after some other committed
transactions):

OQLQuery queryObj = _odmg.newOQLQuery();
String   query    = ... // some basic select

_tx.begin();
queryObj.create(query);
DList result = (DList)queryObj.execute();
_tx.commit();

I get an IllegalStateException thrown in
DelegatingPersistenceBroker.getBroker() while the query executes. When
debugging I can see that in the execute method the collection is correctly
retrieved but the following locking (performLockingIfRequired) seemingly
tries to use an already closed broker.
Any idea what might cause this ?

BTW, I use the CVS version from August 1st with MySQL.

Thanks,
Tom 



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


Re: auto-* settings and ODMG

Posted by Thomas Mahler <th...@web.de>.
Hi again Thomas

Thomas Dudziak wrote:
> Could you please elaborate this a bit further ? Does that mean that if I 
> have a reference or collection to/with some other ojb-persistent class 
> then these objects will be written automatically (i.e. intrinsic 
> auto-update=true) ?

exactly! We have to implement it in this way as ODMG claims to provide 
"persistence by reachability".
That is if a root object is registered to a transaction all associated 
objects become persistent as well.

cheers,
thomas

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


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


Re: auto-* settings and ODMG

Posted by Thomas Dudziak <to...@first.fhg.de>.
Could you please elaborate this a bit further ? Does that mean that if I 
have a reference or collection to/with some other ojb-persistent class 
then these objects will be written automatically (i.e. intrinsic 
auto-update=true) ?

Thanks,
Tom


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


Re: auto-* settings and ODMG

Posted by Thomas Mahler <th...@web.de>.
Hi Thomas,

Thomas Dudziak wrote:
> Hi,
> 
> could please somebody explain why the auto- settings (auto-retrieve,
> auto-delete, auto-update) should only be used with the default settings
> when using ODMG (or JDO) ?
> 

Usinf auto-update="true" results in double inserts for dependend 
objects. As the ODMG or JDO transaction manager registers the dependend 
objects for insertion and the auto-update flag triggers the 
PersistenceBroker to insert the dependend objects a second time...

> To give an example, how would I implement a composition (object of type A
> "owns" n objects of type B -> collection) which naturally (at least I
> think) use auto-delete and perhaps auto-update, for the ODMG
> implementation ?

I think using auto-delete="true" should be OK in this case. If you see 
exceptions for DELETE statements that try to delete objects twice, 
you'll see the same behaviour as with the INSERTS.


cheers,
Thomas

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


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