You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Armin Waibel <ar...@code-au-lait.de> on 2003/09/18 02:21:52 UTC

[ObjectCache] per class/ per database setting introduced

Hi all,

add support for per class and per jcdAlias ObjectCache
declaration (thanks Matthew and Oleg for support).
This was recently a frequently asked "feature".
 
Now it is possible to specify a ObjectCache
implementation with a new introduced element
'object-cache' (intern mapped to ObjectCacheDescriptor)
on jdbc-connection-descriptor level and class-descriptor
level. ObjectCache implementation specific
properties can be passed by using the 'attribute' element, e.g.
___________________________________
<class-descriptor
      class="org.apache.ojb.broker.metadata.MetadataTest$CacheObject"
      table="YYY"
  >

  <object-cache
      class="org.apache.ojb.broker.cache.ObjectCacheDefaultImpl">
          <attribute attribute-name="timeout" attribute-value="2000"/>
   </object-cache>

   <field-descriptor
         name="objId"
.......
___________________________________

To be compatible with current versions of OJB, the
ObjectCache [OC] declaration in OJB.properties file is also
valid. In OJB.properties file the 'standard/default' cache
is declared.
The priority of the different declaration levels are
per class > per jcdAlias > standard ObjectCache (OJB.properties)

Further on I introduced a new property 'descriptorBasedCaches'
in OJB.properties. It's a little bit hard to explain why we need
this - maybe I'm wrong, or someone can find a smarter solution.

OJB allows to change metadata at runtime (currently it's possible
to switch between different DescriptorRepository). Thus for
one class (with two different class-descriptor) two different
ObjectDescriptors can be declared. But by default class name is used to
map ObjectCache instances declared on class-descriptor level
--> second OC override the first OC implementation.
If 'descriptorBasedCaches' is set 'true', the ObjectCacheDescriptor
instance itself is used as key to find a per class OC implementation.
This makes it possible to use different OC instances for the same
class.
But I'm not sure if we really need this?

Will check in updated docs in near future ;-)

regards,
Armin





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


ojb-blank.jar

Posted by Brian McCallister <mc...@forthillcompany.com>.
Added a build target modeled after struts-blank to help newbies get 
started being productive quickly.

ant ojb-blank

Is there anyone better than me with Torque who could add in database 
creation/schema generation targets to the ojb-blank build.xml in a 
fairly minimalist way. I started to but realized I was going to hack it 
in rather than make it anything worth showing off to newbies.

-Brian


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