db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/ejb/org/apache/ojb/ejb/pb PBBaseBeanImpl.java PBSessionBean.java PersonArticleManagerPBBean.java
Date Wed, 11 Aug 2004 00:46:57 GMT
arminw      2004/08/10 17:46:57

  Modified:    src/doc/forrest/src/documentation/content/xdocs/docu/guides
                        deployment.xml objectcache.xml
               src/ejb/org/apache/ojb/ejb/pb PBBaseBeanImpl.java
                        PBSessionBean.java PersonArticleManagerPBBean.java
  Log:
  initial version of OJB 1.1
  
  Revision  Changes    Path
  1.3       +3 -4      db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/deployment.xml
  
  Index: deployment.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/deployment.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- deployment.xml	30 Jun 2004 21:57:11 -0000	1.2
  +++ deployment.xml	11 Aug 2004 00:46:56 -0000	1.3
  @@ -986,9 +986,8 @@
                   <ul>
                       <li>
                           Class
  -                        <code>org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory</code>
for PB-api.
  -                        Make method
  -                        <code>PersistenceBrokerFactoryFactory.instance()</code>
accessible.
  +                        <code>org.apache.ojb.OJB</code> for PB-api.
  +                        Make an instance of this class accessible via JNDI.
                       </li>
                       <li>
                           Class
  
  
  
  1.3       +8 -33     db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/objectcache.xml
  
  Index: objectcache.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/objectcache.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- objectcache.xml	4 Aug 2004 00:12:41 -0000	1.2
  +++ objectcache.xml	11 Aug 2004 00:46:56 -0000	1.3
  @@ -273,43 +273,18 @@
                           </td>
                       </tr>
                       <tr>
  -                        <td>autoSync</td>
  +                        <td>useSoftReferences</td>
                           <td>
  -                            If set
  -                            <em>true</em> all cached/looked up objects within
a PB-transaction are traced.
  -                            If the the PB-transaction was aborted all traced objects will
be removed from
  -                            cache. Default is
  -                            <em>false</em>.
  -                            <p>
  -                                <strong>NOTE:</strong> This does not prevent
"dirty-reads" by concurrent threads (more info see above).
  -                            </p>
  -                            <p>
  -                                It's not a smart solution for keeping cache in sync with
DB but should do the job
  -                                in most cases.
  -                                <br/>
  -                                E.g. if you lookup 1000 objects within a transaction and
modify one object and then abort the
  -                                transaction, 1000 objects will be passed to cache, 1000
objects will be traced and
  -                                all 1000 objects will be removed from cache. If you read
these objects without tx or
  -                                in a former tx and then modify one object in a tx and abort
the tx, only one object was
  -                                traced/removed.
  -                            </p>
  +                            If set <em>true</em> this class use {@link java.lang.ref.SoftReference}
to cache
  +                            objects. Default value is <em>true</em>.
                           </td>
                       </tr>
                       <tr>
  -                        <td>cachingKeyType</td>
  +                        <td>maxEntry</td>
                           <td>
  -                            Determines how the key was build for the cached objects:
  -                            <br/>
  -                            0 - Identity object was used as key, this was the <em>default</em>
setting.
  -                            <br/>
  -                            1 - Idenity + jcdAlias name was used as key. Useful when the
same object metadata model
  -                            (DescriptorRepository instance) are used for different databases
(JdbcConnectionDescriptor)
  -                            <br/>
  -                            2 - Identity + model (DescriptorRepository) was used as key.
Useful when different metadata
  -                            model (DescriptorRepository instance) are used for the same
database. Keep in mind that there
  -                            was no synchronization between cached objects with same Identity
but different metadata model.
  -                            <br/>
  -                            3 - all together (Idenity + jcdAlias + model)
  +                            If <em>maxEntry</em> is set to an integer value
> 0 this class use a LRUMap to cache objects which removes
  +                            the least recently used entry if an entry is added when full.
If set less than 0 a normal
  +                            Map is used to cache the objects. Default value is <em>-1</em>.
                           </td>
                       </tr>
                   </table>
  
  
  
  1.5       +4 -9      db-ojb/src/ejb/org/apache/ojb/ejb/pb/PBBaseBeanImpl.java
  
  Index: PBBaseBeanImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/ejb/org/apache/ojb/ejb/pb/PBBaseBeanImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PBBaseBeanImpl.java	5 Apr 2004 00:17:08 -0000	1.4
  +++ PBBaseBeanImpl.java	11 Aug 2004 00:46:56 -0000	1.5
  @@ -20,8 +20,7 @@
   
   import org.apache.ojb.broker.PBKey;
   import org.apache.ojb.broker.PersistenceBroker;
  -import org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory;
  -import org.apache.ojb.broker.core.PersistenceBrokerFactoryIF;
  +import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.query.Query;
   import org.apache.ojb.broker.query.QueryByCriteria;
   import org.apache.ojb.broker.util.logging.Logger;
  @@ -51,20 +50,16 @@
   public abstract class PBBaseBeanImpl extends SessionBeanImpl
   {
       private Logger log = LoggerFactory.getLogger(PBBaseBeanImpl.class);
  -    private PersistenceBrokerFactoryIF pbf;
   
       public void ejbRemove()
       {
           super.ejbRemove();
  -        // we do explicit cleanup (not necessary)
  -        pbf = null;
           log = null;
       }
   
       public void ejbCreate()
       {
           if (log.isDebugEnabled()) log.info("ejbCreate was called");
  -        pbf = PersistenceBrokerFactoryFactory.instance();
       }
   
       /**
  @@ -72,7 +67,7 @@
        */
       public PersistenceBroker getBroker()
       {
  -        return pbf.defaultPersistenceBroker();
  +        return PersistenceBrokerFactory.defaultPersistenceBroker();
       }
   
       /**
  @@ -81,7 +76,7 @@
        */
       public PersistenceBroker getBroker(PBKey key)
       {
  -        return pbf.createPersistenceBroker(key);
  +        return PersistenceBrokerFactory.createPersistenceBroker(key);
       }
   
       /**
  
  
  
  1.6       +3 -6      db-ojb/src/ejb/org/apache/ojb/ejb/pb/PBSessionBean.java
  
  Index: PBSessionBean.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/ejb/org/apache/ojb/ejb/pb/PBSessionBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PBSessionBean.java	5 Apr 2004 00:17:08 -0000	1.5
  +++ PBSessionBean.java	11 Aug 2004 00:46:56 -0000	1.6
  @@ -24,8 +24,7 @@
   import java.util.List;
   
   import org.apache.ojb.broker.PersistenceBroker;
  -import org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory;
  -import org.apache.ojb.broker.core.PersistenceBrokerFactoryIF;
  +import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.query.Criteria;
   import org.apache.ojb.broker.query.Query;
   import org.apache.ojb.broker.query.QueryByCriteria;
  @@ -74,7 +73,6 @@
   {
       private Logger log = LoggerFactory.getLogger(PBSessionBean.class);
       private SessionContext ctx;
  -    private PersistenceBrokerFactoryIF pbf;
   
       public PBSessionBean()
       {
  @@ -106,13 +104,12 @@
       public void ejbCreate()
       {
           log.info("ejbCreate was called");
  -        pbf = PersistenceBrokerFactoryFactory.instance();
       }
   
       protected PersistenceBroker getBroker()
       {
           if(log.isDebugEnabled()) log.debug("getBroker was called");
  -        return pbf.defaultPersistenceBroker();
  +        return PersistenceBrokerFactory.defaultPersistenceBroker();
       }
   
       protected List storeObjects(PersistenceBroker broker, List objects)
  
  
  
  1.7       +3 -4      db-ojb/src/ejb/org/apache/ojb/ejb/pb/PersonArticleManagerPBBean.java
  
  Index: PersonArticleManagerPBBean.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/ejb/org/apache/ojb/ejb/pb/PersonArticleManagerPBBean.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PersonArticleManagerPBBean.java	5 Jul 2004 11:45:53 -0000	1.6
  +++ PersonArticleManagerPBBean.java	11 Aug 2004 00:46:56 -0000	1.7
  @@ -27,7 +27,7 @@
   import java.util.List;
   
   import org.apache.ojb.broker.PersistenceBroker;
  -import org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory;
  +import org.apache.ojb.broker.PersistenceBrokerFactory;
   import org.apache.ojb.broker.core.PersistenceBrokerFactoryIF;
   import org.apache.ojb.broker.query.Query;
   import org.apache.ojb.broker.query.QueryByCriteria;
  @@ -94,7 +94,6 @@
   
       public void ejbCreate()
       {
  -        pbf = PersistenceBrokerFactoryFactory.instance();
       }
   
       /**
  @@ -104,7 +103,7 @@
        */
       public void storeUsingNestedPB(List articles, List persons)
       {
  -        PersistenceBroker broker = pbf.defaultPersistenceBroker();
  +        PersistenceBroker broker = PersistenceBrokerFactory.defaultPersistenceBroker();
           try
           {
               // do something with broker
  
  
  

---------------------------------------------------------------------
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