dblevins    2005/08/26 18:00:07

  Modified:    modules/core/src/java/org/openejb/resource/jdbc
                        BasicManagedConnectionFactory.java
                        JdbcManagedConnectionFactory.java
  Log:

  Changes to deal with the fact that we are now wrapping the 
ManagedConnectionFactory.
  Passing "this" around won't work so well.
  
  Revision  Changes    Path
  1.2       +7 -5      
openejb1/modules/core/src/java/org/openejb/resource/jdbc/BasicManagedConnectionFactory.java
  
  Index: BasicManagedConnectionFactory.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb1/modules/core/src/java/org/openejb/resource/jdbc/BasicManagedConnectionFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BasicManagedConnectionFactory.java        23 Aug 2005 04:12:53 -0000      
1.1
  +++ BasicManagedConnectionFactory.java        26 Aug 2005 22:00:07 -0000      
1.2
  @@ -64,8 +64,10 @@
       private final String defaultPassword;
       private java.io.PrintWriter logWriter;
       private final int hashCode;
  +    private final JdbcManagedConnectionFactory managedConnectionFactory;
   
  -    public BasicManagedConnectionFactory(String jdbcDriver, String jdbcUrl, 
String defaultUserName, String defaultPassword) {
  +    public BasicManagedConnectionFactory(JdbcManagedConnectionFactory 
factory, String jdbcDriver, String jdbcUrl, String defaultUserName, String 
defaultPassword) {
  +        this.managedConnectionFactory = factory;
           this.jdbcDriver = jdbcDriver;
           this.jdbcUrl = jdbcUrl;
           this.defaultUserName = defaultUserName;
  @@ -78,14 +80,14 @@
       }
   
       public Object createConnectionFactory(ConnectionManager cxManager) 
throws javax.resource.ResourceException {
  -        return new JdbcConnectionFactory(this, cxManager, jdbcUrl, 
jdbcDriver, defaultPassword, defaultUserName);
  +        return new JdbcConnectionFactory(managedConnectionFactory, 
cxManager, jdbcUrl, jdbcDriver, defaultPassword, defaultUserName);
       }
   
       public ManagedConnection createManagedConnection(Subject subject, 
ConnectionRequestInfo connectionRequestInfo) throws 
javax.resource.ResourceException {
           try {
               JdbcConnectionRequestInfo request = (JdbcConnectionRequestInfo) 
connectionRequestInfo;
               Connection connection = DriverManager.getConnection(jdbcUrl, 
request.getUserName(), request.getPassword());
  -            return new JdbcManagedConnection(this, connection, request);
  +            return new JdbcManagedConnection(managedConnectionFactory, 
connection, request);
           } catch (java.sql.SQLException e) {
               throw (EISSystemException)new EISSystemException("Could not 
obtain a physical JDBC connection from the DriverManager").initCause(e);
           }
  
  
  
  1.8       +2 -2      
openejb1/modules/core/src/java/org/openejb/resource/jdbc/JdbcManagedConnectionFactory.java
  
  Index: JdbcManagedConnectionFactory.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb1/modules/core/src/java/org/openejb/resource/jdbc/JdbcManagedConnectionFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JdbcManagedConnectionFactory.java 23 Aug 2005 04:12:53 -0000      1.7
  +++ JdbcManagedConnectionFactory.java 26 Aug 2005 22:00:07 -0000      1.8
  @@ -70,7 +70,7 @@
   
           loadDriver(driver);
   
  -        factory = new BasicManagedConnectionFactory(driver, url, 
defaultUserName, defaultPassword);
  +        factory = new BasicManagedConnectionFactory(this, driver, url, 
defaultUserName, defaultPassword);
   
           if (driver.equals("org.enhydra.instantdb.jdbc.idbDriver")) {
               factory = new ManagedConnectionFactoryPathHack(factory);
  
  
  

Reply via email to