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/java/org/apache/ojb/broker/accesslayer ConnectionFactoryFactory.java
Date Tue, 24 Feb 2004 19:25:31 GMT
arminw      2004/02/24 11:25:31

  Modified:    src/java/org/apache/ojb/broker/accesslayer
                        ConnectionFactoryFactory.java
  Log:
  make sure that we use a single instance
  
  Revision  Changes    Path
  1.8       +7 -7      db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryFactory.java
  
  Index: ConnectionFactoryFactory.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/ConnectionFactoryFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ConnectionFactoryFactory.java	15 Jan 2003 10:43:28 -0000	1.7
  +++ ConnectionFactoryFactory.java	24 Feb 2004 19:25:31 -0000	1.8
  @@ -65,19 +65,19 @@
    */
   public class ConnectionFactoryFactory extends ConfigurableFactory
   {
  -    private static ConnectionFactoryFactory singleton;
  +    private static ConnectionFactoryFactory singleton = new ConnectionFactoryFactory();
       private ConnectionFactory conFactory;
   
       public synchronized static ConnectionFactoryFactory getInstance()
       {
  -        if (singleton == null)
  -        {
  -            singleton = new ConnectionFactoryFactory();
  -        }
           return singleton;
       }
   
  -    public ConnectionFactory createConnectionFactory()
  +    /**
  +     * Returns the used {@link ConnectionFactory} implementation. Currently each call
  +     * returns the same implementation instance.
  +     */
  +    public synchronized ConnectionFactory createConnectionFactory()
       {
           if (conFactory == null)
           {
  
  
  

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