Changeset 2583


Ignore:
Timestamp:
Aug 18, 2014, 11:11:21 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #617: Re-use server connections within a transaction

Fixes a NullPointerException when listing possible connection managers for a file server.

Location:
extensions/net.sf.basedb.xfiles/trunk/src/net/sf/basedb/xfiles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.xfiles/trunk/src/net/sf/basedb/xfiles/ftp/FtpConnectionManagerActionFactory.java

    r2572 r2583  
    6767      initFactory(context);
    6868    }
    69     DbControl dc = context.getClientContext().getDbControl();
    70     if (dc != null && !dc.isClosed())
     69    if (context.getClientContext() != null)
    7170    {
    72       // Initialize a connection cache hooked up to the current transaction
    73       FtpConnectionManager.CONNECTION_CACHE.init(dc);
     71      DbControl dc = context.getClientContext().getDbControl();
     72      if (dc != null && !dc.isClosed())
     73      {
     74        // Initialize a connection cache hooked up to the current transaction
     75        FtpConnectionManager.CONNECTION_CACHE.init(dc);
     76      }
    7477    }
    7578    return new ConnectionManagerFactory[] { factory };
  • extensions/net.sf.basedb.xfiles/trunk/src/net/sf/basedb/xfiles/sftp/SftpConnectionManagerActionFactory.java

    r2571 r2583  
    6767      initFactory(context);
    6868    }
    69     DbControl dc = context.getClientContext().getDbControl();
    70     if (dc != null && !dc.isClosed())
     69    if (context.getClientContext() != null)
    7170    {
    72       // Initialize a connection cache hooked up to the current transaction
    73       SftpConnectionManager.CONNECTION_CACHE.init(dc);
     71      DbControl dc = context.getClientContext().getDbControl();
     72      if (dc != null && !dc.isClosed())
     73      {
     74        // Initialize a connection cache hooked up to the current transaction
     75        SftpConnectionManager.CONNECTION_CACHE.init(dc);
     76      }
    7477    }
    7578    return new ConnectionManagerFactory[] { factory };
Note: See TracChangeset for help on using the changeset viewer.