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 Henrik Berg <he...@ifi.uio.no> on 2003/06/12 13:14:39 UTC

Specifying collection-class gives error...

This is weird...

Suddenly (or so it seems...), OJB wants all my collections to be
RemovalAwareCollections.  

When I retrieve an object with a Collection from the database, OJB
seems to instantiate the collection to a RemovalAwareCollection before
it is added to the object.  So if the field in questions is declared
as, say, ArrayList, I get an error.  Then if I try to say 
collection-class="java.util.ArrayList", I get a ClassCastException...

Any tips on where the error may be?

-- 
Henrik

Re: Possible CollectionProxy bug?

Posted by Thomas Mahler <th...@web.de>.
Hi Edson,
It still on my todo list (but quite close to the top now!)

Edson Carlos Ericksson Richter wrote:
> Anyone can confirm that this is a bug or not?
> 
> Thanks,
> 
> Edson Richter
> ----- Original Message ----- 
> From: "Edson Carlos Ericksson Richter" <ed...@mgrinformatica.com.br>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, June 12, 2003 11:13 AM
> Subject: Possible CollectionProxy bug?
> 
> 
> I think I get RemovalAwareCollection working with proxied classes.
> 
> The method afterStore in CollectionProxy should not be:
> 
> 
>     public void afterStore(PersistenceBroker broker) throws
> PersistenceBrokerException
>     {
>       Collection c = getData();
> 
>       if( c instanceof ManageableCollection )
>         ( ( ManageableCollection )c ).afterStore( broker );
> 
>     }
> 
> 
> Thomas, can you confirm this?
> 
> Thanks,
> 
> Edson Richter
> 
> 
> 
> 
> ----- Original Message ----- 
> From: "onno" <on...@onnos.com>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, June 12, 2003 9:22 AM
> Subject: Auto-delete woes
> 
> 
> Long time no post but we found a strange behaviour in our app which
> otherwise has been running fine.
> 
> it involves the auto-delete
> 
> we use
> 
> Broker.deleteByQuery(aQuery); //where the Query is just a 1 Primary Key from
> an object.
> 
> This however doesn't seem to delete any linked objects (ie per defined in
> auto-delete)
> 
> eg:
> 
>   Request (auto-everything == true ;)
>      1-1 with a Interaction  (auto-everything == true ;)
>                            1-1 with a (Temp User) (auto-everything == true
> ;)
> 
> when we delete a request it gets deleted however the Interaction Object
> sticks around and
> needless to say also the Temp User.
> 
> Any logic error we do?
> 
> Greetz
> 
> Onno
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.489 / Virus Database: 288 - Release Date: 10/6/2003
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 


Re: Possible CollectionProxy bug?

Posted by Thomas Mahler <th...@web.de>.
confirmed and fixed!

Edson Carlos Ericksson Richter wrote:
> Anyone can confirm that this is a bug or not?
> 
> Thanks,
> 
> Edson Richter
> ----- Original Message ----- 
> From: "Edson Carlos Ericksson Richter" <ed...@mgrinformatica.com.br>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, June 12, 2003 11:13 AM
> Subject: Possible CollectionProxy bug?
> 
> 
> I think I get RemovalAwareCollection working with proxied classes.
> 
> The method afterStore in CollectionProxy should not be:
> 
> 
>     public void afterStore(PersistenceBroker broker) throws
> PersistenceBrokerException
>     {
>       Collection c = getData();
> 
>       if( c instanceof ManageableCollection )
>         ( ( ManageableCollection )c ).afterStore( broker );
> 
>     }
> 
> 
> Thomas, can you confirm this?
> 
> Thanks,
> 
> Edson Richter
> 
> 
> 
> 
> ----- Original Message ----- 
> From: "onno" <on...@onnos.com>
> To: "OJB Users List" <oj...@db.apache.org>
> Sent: Thursday, June 12, 2003 9:22 AM
> Subject: Auto-delete woes
> 
> 
> Long time no post but we found a strange behaviour in our app which
> otherwise has been running fine.
> 
> it involves the auto-delete
> 
> we use
> 
> Broker.deleteByQuery(aQuery); //where the Query is just a 1 Primary Key from
> an object.
> 
> This however doesn't seem to delete any linked objects (ie per defined in
> auto-delete)
> 
> eg:
> 
>   Request (auto-everything == true ;)
>      1-1 with a Interaction  (auto-everything == true ;)
>                            1-1 with a (Temp User) (auto-everything == true
> ;)
> 
> when we delete a request it gets deleted however the Interaction Object
> sticks around and
> needless to say also the Temp User.
> 
> Any logic error we do?
> 
> Greetz
> 
> Onno
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.489 / Virus Database: 288 - Release Date: 10/6/2003
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
> 
> 


Re: Possible CollectionProxy bug?

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
Anyone can confirm that this is a bug or not?

Thanks,

Edson Richter
----- Original Message ----- 
From: "Edson Carlos Ericksson Richter" <ed...@mgrinformatica.com.br>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, June 12, 2003 11:13 AM
Subject: Possible CollectionProxy bug?


I think I get RemovalAwareCollection working with proxied classes.

The method afterStore in CollectionProxy should not be:


    public void afterStore(PersistenceBroker broker) throws
PersistenceBrokerException
    {
      Collection c = getData();

      if( c instanceof ManageableCollection )
        ( ( ManageableCollection )c ).afterStore( broker );

    }


Thomas, can you confirm this?

Thanks,

Edson Richter




----- Original Message ----- 
From: "onno" <on...@onnos.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, June 12, 2003 9:22 AM
Subject: Auto-delete woes


Long time no post but we found a strange behaviour in our app which
otherwise has been running fine.

it involves the auto-delete

we use

Broker.deleteByQuery(aQuery); //where the Query is just a 1 Primary Key from
an object.

This however doesn't seem to delete any linked objects (ie per defined in
auto-delete)

eg:

  Request (auto-everything == true ;)
     1-1 with a Interaction  (auto-everything == true ;)
                           1-1 with a (Temp User) (auto-everything == true
;)

when we delete a request it gets deleted however the Interaction Object
sticks around and
needless to say also the Temp User.

Any logic error we do?

Greetz

Onno


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


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003



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




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.489 / Virus Database: 288 - Release Date: 10/6/2003



Possible CollectionProxy bug?

Posted by Edson Carlos Ericksson Richter <ed...@mgrinformatica.com.br>.
I think I get RemovalAwareCollection working with proxied classes.

The method afterStore in CollectionProxy should not be:


    public void afterStore(PersistenceBroker broker) throws
PersistenceBrokerException
    {
      Collection c = getData();

      if( c instanceof ManageableCollection )
        ( ( ManageableCollection )c ).afterStore( broker );

    }


Thomas, can you confirm this?

Thanks,

Edson Richter




----- Original Message ----- 
From: "onno" <on...@onnos.com>
To: "OJB Users List" <oj...@db.apache.org>
Sent: Thursday, June 12, 2003 9:22 AM
Subject: Auto-delete woes


Long time no post but we found a strange behaviour in our app which
otherwise has been running fine.

it involves the auto-delete

we use

Broker.deleteByQuery(aQuery); //where the Query is just a 1 Primary Key from
an object.

This however doesn't seem to delete any linked objects (ie per defined in
auto-delete)

eg:

  Request (auto-everything == true ;)
     1-1 with a Interaction  (auto-everything == true ;)
                           1-1 with a (Temp User) (auto-everything == true
;)

when we delete a request it gets deleted however the Interaction Object
sticks around and
needless to say also the Temp User.

Any logic error we do?

Greetz

Onno


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


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.488 / Virus Database: 287 - Release Date: 5/6/2003



Auto-delete woes

Posted by onno <on...@onnos.com>.
Long time no post but we found a strange behaviour in our app which
otherwise has been running fine.

it involves the auto-delete

we use

Broker.deleteByQuery(aQuery); //where the Query is just a 1 Primary Key from
an object.

This however doesn't seem to delete any linked objects (ie per defined in
auto-delete)

eg:

  Request (auto-everything == true ;)
     1-1 with a Interaction  (auto-everything == true ;)
                           1-1 with a (Temp User) (auto-everything == true
;)

when we delete a request it gets deleted however the Interaction Object
sticks around and
needless to say also the Temp User.

Any logic error we do?

Greetz

Onno