db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Braeuchi <jbraeu...@gmx.ch>
Subject Re: [CVS OJB tests fail] broker leak in cache
Date Fri, 14 Feb 2003 17:55:34 GMT
hi armin,

>in your implementation you forgot to call PB.close() after using
>the broker, in the Identity constructor this was done.

now i understand. stupid me :(

jakob



Armin Waibel wrote:

>----- Original Message -----
>From: "Jakob Braeuchi" <jbraeuchi@gmx.ch>
>To: "OJB Developers List" <ojb-dev@db.apache.org>
>Sent: Friday, February 14, 2003 6:35 PM
>Subject: Re: [CVS OJB tests fail] broker leak in cache
>
>
>  
>
>>hi armin,
>>
>>but why didn't this happen when using Identity(Object obj) which is
>>    
>>
>also
>  
>
>>using the default broker behind the scenes ??
>>could you please explain the details to me ?
>>    
>>
>
>in your implementation you forgot to call PB.close() after using
>the broker, in the Identity constructor this was done.
>
>And I declared the Identity(Object ojb) constructor deprecated,
>because when multiple databases were used the Identity was
>only unique when the Identity instance knows to which database
>the objects belongs (reason: we generate the PK values of the object).
>
>HTH
>regards,
>Armin
>
>  
>
>>jakob
>>
>>
>>Armin Waibel wrote:
>>
>>    
>>
>>>----- Original Message -----
>>>From: "Jakob Braeuchi" <jbraeuchi@gmx.ch>
>>>To: "OJB Developers List" <ojb-dev@db.apache.org>
>>>Sent: Friday, February 14, 2003 6:03 PM
>>>Subject: Re: [CVS OJB tests fail] broker leak in cache
>>>
>>>
>>>
>>>
>>>      
>>>
>>>>hi armin,
>>>>
>>>>i do not understand why it worked before.
>>>>new Identity(Object obj) also uses the default broker.
>>>>
>>>>   public Identity(Object objectToIdentitify)
>>>>   {
>>>>       PersistenceBroker broker = null;
>>>>       try
>>>>       {
>>>>           broker =
>>>>PersistenceBrokerFactory.defaultPersistenceBroker();  <<<<
>>>>           init(objectToIdentitify, broker, null);
>>>>...
>>>>
>>>>where's the difference ? can you please explain this to me...
>>>>
>>>>
>>>>        
>>>>
>>>your implementation cause a broker leak. The obtained PB instances
>>>never be closed.
>>>
>>>regards,
>>>Armin
>>>
>>>
>>>
>>>      
>>>
>>>>jakob
>>>>
>>>>Armin Waibel wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>>>Hi Jakob,
>>>>>
>>>>>----- Original Message -----
>>>>>From: "Jakob Braeuchi" <jbraeuchi@gmx.ch>
>>>>>To: "OJB Developers List" <ojb-dev@db.apache.org>
>>>>>Sent: Friday, February 14, 2003 5:17 PM
>>>>>Subject: Re: [CVS OJB tests fail] broker leak in cache
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>hi armin,
>>>>>>
>>>>>>did it work _before_ my changes ? if yes i could undo them.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>yes it worked without your changes.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>a) remove the public void cache(Object obj)
>>>>>>i agree. this method is imo never used in ojb.
>>>>>>
>>>>>>b) change method remove(Object obj)
>>>>>>i think this should be ok
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>ok, I'm started to make these changes
>>>>>in the cache package.
>>>>>
>>>>>regards,
>>>>>Armin
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>jakob
>>>>>>
>>>>>>
>>>>>>Armin Waibel wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>Hi all,
>>>>>>>
>>>>>>>in CVS ObjectCacheDefaultImpl we had
>>>>>>>a PB leak.
>>>>>>>This is caused by using PBF.defaultPB calls
>>>>>>>without closing the broker. Jakob add this to avoid
>>>>>>>using of deprecated Identity constructor.
>>>>>>>But the real problem is that this solution never
>>>>>>>will work, because of using the default broker.
>>>>>>>
>>>>>>>Thus I propose the following changes in ObjectCache:
>>>>>>>a) remove the
>>>>>>>public void cache(Object obj) throws
>>>>>>>ClassNotPersistenceCapableException;
>>>>>>>method, this will never work.
>>>>>>>
>>>>>>>b) change method
>>>>>>>public void remove(Object obj);
>>>>>>>to
>>>>>>>public void remove(Identity oid);
>>>>>>>
>>>>>>>What do you think?
>>>>>>>
>>>>>>>
>>>>>>>regards,
>>>>>>>Armin
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>--------------------------------------------------------------------
>>>>>          
>>>>>
>-
>  
>
>>>>>>            
>>>>>>
>>>>>>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>>>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>---------------------------------------------------------------------
>>>>        
>>>>
>>>>>          
>>>>>
>>>>>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>---------------------------------------------------------------------
>>>>        
>>>>
>>>>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>---------------------------------------------------------------------
>>>      
>>>
>>>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>>For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>For additional commands, e-mail: ojb-dev-help@db.apache.org
>
>
>  
>


Mime
View raw message