test_class.declarator: SCHEMA_PATTERN = "schema_%s"
test_class.modifier: private static final
test_class.original_string: private static final String SCHEMA_PATTERN = "schema_%s";
test_class.type: String
test_class.var_name: SCHEMA_PATTERN
test_class.declarator: backendDataSource
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private JDBCBackendDataSource backendDataSource;
test_class.type: JDBCBackendDataSource
test_class.var_name: backendDataSource
test_class.declarator: backendConnection = new BackendConnection(TransactionType.LOCAL)
test_class.modifier: private final
test_class.original_string: private final BackendConnection backendConnection = new BackendConnection(TransactionType.LOCAL);
test_class.type: BackendConnection
test_class.var_name: backendConnection
test_class.file: shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnectionTest.java
test_class.identifier: BackendConnectionTest
test_case.body: @Test
      public void assertCloseConnectionsCorrectlyWhenForceRollbackAndNotInTransaction() throws SQLException {
          ConnectionStatus connectionStatus = mock(ConnectionStatus.class);
          prepareConnectionStatus(connectionStatus);
          backendConnection.getTransactionStatus().setInTransaction(false);
          Connection connection = prepareCachedConnections();
          backendConnection.closeConnections(true);
          verify(connection, never()).rollback();
          verify(connectionStatus, times(1)).switchToReleased();
      }
test_case.class_method_signature: BackendConnectionTest.assertCloseConnectionsCorrectlyWhenForceRollbackAndNotInTransaction()
test_case.full_signature: @Test public void assertCloseConnectionsCorrectlyWhenForceRollbackAndNotInTransaction()
test_case.identifier: assertCloseConnectionsCorrectlyWhenForceRollbackAndNotInTransaction
test_case.invocations: mock prepareConnectionStatus setInTransaction getTransactionStatus prepareCachedConnections closeConnections rollback verify never switchToReleased verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertCloseConnectionsCorrectlyWhenForceRollbackAndNotInTransaction()
focal_class.declarator: schemaName
focal_class.modifier: private volatile
focal_class.original_string: private volatile String schemaName;
focal_class.type: String
focal_class.var_name: schemaName
focal_class.declarator: connectionId
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private int connectionId;
focal_class.type: int
focal_class.var_name: connectionId
focal_class.declarator: username
focal_class.modifier: @Setter
      private
focal_class.original_string: @Setter
      private String username;
focal_class.type: String
focal_class.var_name: username
focal_class.declarator: cachedConnections = LinkedHashMultimap.create()
focal_class.modifier: private final
focal_class.original_string: private final Multimap<String, Connection> cachedConnections = LinkedHashMultimap.create();
focal_class.type: Multimap<String, Connection>
focal_class.var_name: cachedConnections
focal_class.declarator: cachedStatements = new CopyOnWriteArrayList<>()
focal_class.modifier: private final
focal_class.original_string: private final Collection<Statement> cachedStatements = new CopyOnWriteArrayList<>();
focal_class.type: Collection<Statement>
focal_class.var_name: cachedStatements
focal_class.declarator: cachedResultSets = new CopyOnWriteArrayList<>()
focal_class.modifier: private final
focal_class.original_string: private final Collection<ResultSet> cachedResultSets = new CopyOnWriteArrayList<>();
focal_class.type: Collection<ResultSet>
focal_class.var_name: cachedResultSets
focal_class.declarator: methodInvocations = new LinkedList<>()
focal_class.modifier: private final
focal_class.original_string: private final Collection<MethodInvocation> methodInvocations = new LinkedList<>();
focal_class.type: Collection<MethodInvocation>
focal_class.var_name: methodInvocations
focal_class.declarator: resourceLock = new ResourceLock()
focal_class.modifier: private final
focal_class.original_string: private final ResourceLock resourceLock = new ResourceLock();
focal_class.type: ResourceLock
focal_class.var_name: resourceLock
focal_class.declarator: connectionStatus = new ConnectionStatus()
focal_class.modifier: private final
focal_class.original_string: private final ConnectionStatus connectionStatus = new ConnectionStatus();
focal_class.type: ConnectionStatus
focal_class.var_name: connectionStatus
focal_class.declarator: transactionStatus
focal_class.modifier: private final
focal_class.original_string: private final TransactionStatus transactionStatus;
focal_class.type: TransactionStatus
focal_class.var_name: transactionStatus
focal_class.file: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/BackendConnection.java
focal_class.identifier: BackendConnection
focal_class.interfaces: implements JDBCExecutionConnection
focal_class.class_method_signature: BackendConnection.BackendConnection(final TransactionType initialTransactionType)
focal_class.full_signature: public  BackendConnection(final TransactionType initialTransactionType)
focal_class.identifier: BackendConnection
focal_class.modifiers: public
focal_class.parameters: (final TransactionType initialTransactionType)
focal_class.signature:  BackendConnection(final TransactionType initialTransactionType)
focal_class.class_method_signature: BackendConnection.setCurrentSchema(final String schemaName)
focal_class.full_signature: public void setCurrentSchema(final String schemaName)
focal_class.identifier: setCurrentSchema
focal_class.modifiers: public
focal_class.parameters: (final String schemaName)
focal_class.return: void
focal_class.signature: void setCurrentSchema(final String schemaName)
focal_class.class_method_signature: BackendConnection.getConnections(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.full_signature: @Override public List<Connection> getConnections(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.identifier: getConnections
focal_class.modifiers: @Override public
focal_class.parameters: (final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.return: List<Connection>
focal_class.signature: List<Connection> getConnections(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.class_method_signature: BackendConnection.getConnectionsWithTransaction(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.full_signature: private List<Connection> getConnectionsWithTransaction(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.identifier: getConnectionsWithTransaction
focal_class.modifiers: private
focal_class.parameters: (final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.return: List<Connection>
focal_class.signature: List<Connection> getConnectionsWithTransaction(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.class_method_signature: BackendConnection.createNewConnections(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.full_signature: private List<Connection> createNewConnections(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.identifier: createNewConnections
focal_class.modifiers: private
focal_class.parameters: (final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.return: List<Connection>
focal_class.signature: List<Connection> createNewConnections(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.class_method_signature: BackendConnection.getConnectionsWithoutTransaction(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.full_signature: private List<Connection> getConnectionsWithoutTransaction(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.identifier: getConnectionsWithoutTransaction
focal_class.modifiers: private
focal_class.parameters: (final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.return: List<Connection>
focal_class.signature: List<Connection> getConnectionsWithoutTransaction(final String dataSourceName, final int connectionSize, final ConnectionMode connectionMode)
focal_class.class_method_signature: BackendConnection.replayMethodsInvocation(final Object target)
focal_class.full_signature: private void replayMethodsInvocation(final Object target)
focal_class.identifier: replayMethodsInvocation
focal_class.modifiers: private
focal_class.parameters: (final Object target)
focal_class.return: void
focal_class.signature: void replayMethodsInvocation(final Object target)
focal_class.class_method_signature: BackendConnection.createStorageResource(final Connection connection, final ConnectionMode connectionMode, final StatementOption option)
focal_class.full_signature: @Override public Statement createStorageResource(final Connection connection, final ConnectionMode connectionMode, final StatementOption option)
focal_class.identifier: createStorageResource
focal_class.modifiers: @Override public
focal_class.parameters: (final Connection connection, final ConnectionMode connectionMode, final StatementOption option)
focal_class.return: Statement
focal_class.signature: Statement createStorageResource(final Connection connection, final ConnectionMode connectionMode, final StatementOption option)
focal_class.class_method_signature: BackendConnection.createStorageResource(final String sql, final List<Object> parameters, 
                                                     final Connection connection, final ConnectionMode connectionMode, final StatementOption option)
focal_class.full_signature: @Override public PreparedStatement createStorageResource(final String sql, final List<Object> parameters, 
                                                     final Connection connection, final ConnectionMode connectionMode, final StatementOption option)
focal_class.identifier: createStorageResource
focal_class.modifiers: @Override public
focal_class.parameters: (final String sql, final List<Object> parameters, 
                                                     final Connection connection, final ConnectionMode connectionMode, final StatementOption option)
focal_class.return: PreparedStatement
focal_class.signature: PreparedStatement createStorageResource(final String sql, final List<Object> parameters, 
                                                     final Connection connection, final ConnectionMode connectionMode, final StatementOption option)
focal_class.class_method_signature: BackendConnection.setFetchSize(final Statement statement)
focal_class.full_signature: private void setFetchSize(final Statement statement)
focal_class.identifier: setFetchSize
focal_class.modifiers: private
focal_class.parameters: (final Statement statement)
focal_class.return: void
focal_class.signature: void setFetchSize(final Statement statement)
focal_class.class_method_signature: BackendConnection.isSerialExecute()
focal_class.full_signature: public boolean isSerialExecute()
focal_class.identifier: isSerialExecute
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isSerialExecute()
focal_class.class_method_signature: BackendConnection.getConnectionSize()
focal_class.full_signature: public int getConnectionSize()
focal_class.identifier: getConnectionSize
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getConnectionSize()
focal_class.class_method_signature: BackendConnection.add(final Statement statement)
focal_class.full_signature: public void add(final Statement statement)
focal_class.identifier: add
focal_class.modifiers: public
focal_class.parameters: (final Statement statement)
focal_class.return: void
focal_class.signature: void add(final Statement statement)
focal_class.class_method_signature: BackendConnection.add(final ResultSet resultSet)
focal_class.full_signature: public void add(final ResultSet resultSet)
focal_class.identifier: add
focal_class.modifiers: public
focal_class.parameters: (final ResultSet resultSet)
focal_class.return: void
focal_class.signature: void add(final ResultSet resultSet)
focal_class.class_method_signature: BackendConnection.closeResultSets()
focal_class.full_signature: public synchronized Collection<SQLException> closeResultSets()
focal_class.identifier: closeResultSets
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: Collection<SQLException>
focal_class.signature: Collection<SQLException> closeResultSets()
focal_class.class_method_signature: BackendConnection.closeStatements()
focal_class.full_signature: public synchronized Collection<SQLException> closeStatements()
focal_class.identifier: closeStatements
focal_class.modifiers: public synchronized
focal_class.parameters: ()
focal_class.return: Collection<SQLException>
focal_class.signature: Collection<SQLException> closeStatements()
focal_class.class_method_signature: BackendConnection.closeConnections(final boolean forceRollback)
focal_class.full_signature: public synchronized Collection<SQLException> closeConnections(final boolean forceRollback)
focal_class.identifier: closeConnections
focal_class.modifiers: public synchronized
focal_class.parameters: (final boolean forceRollback)
focal_class.return: Collection<SQLException>
focal_class.signature: Collection<SQLException> closeConnections(final boolean forceRollback)
focal_method.body: public synchronized Collection<SQLException> closeConnections(final boolean forceRollback) {
          Collection<SQLException> result = new LinkedList<>();
          for (Connection each : cachedConnections.values()) {
              try {
                  if (forceRollback && transactionStatus.isInTransaction()) {
                      each.rollback();
                  }
                  each.close();
              } catch (final SQLException ex) {
                  result.add(ex);
              }
          }
          cachedConnections.clear();
          methodInvocations.clear();
          connectionStatus.switchToReleased();
          return result;
      }
focal_method.class_method_signature: BackendConnection.closeConnections(final boolean forceRollback)
focal_method.full_signature: public synchronized Collection<SQLException> closeConnections(final boolean forceRollback)
focal_method.identifier: closeConnections
focal_method.invocations: values isInTransaction rollback close add clear clear switchToReleased
focal_method.modifiers: public synchronized
focal_method.parameters: (final boolean forceRollback)
focal_method.return: Collection<SQLException>
focal_method.signature: Collection<SQLException> closeConnections(final boolean forceRollback)