diff --git a/ebean-datasource/src/main/java/io/ebean/datasource/pool/PooledConnection.java b/ebean-datasource/src/main/java/io/ebean/datasource/pool/PooledConnection.java index 6adcd6a..db5f529 100644 --- a/ebean-datasource/src/main/java/io/ebean/datasource/pool/PooledConnection.java +++ b/ebean-datasource/src/main/java/io/ebean/datasource/pool/PooledConnection.java @@ -385,21 +385,12 @@ public PreparedStatement prepareStatement(String sql, int resultSetType, int res * Reset the connection for returning to the client. Resets the status, * startUseTime and hadErrors. */ - void resetForUse() throws SQLException { + void resetForUse() { this.status = STATUS_ACTIVE; this.startUseTime = System.currentTimeMillis(); this.createdByMethod = null; this.lastStatement = null; this.hadErrors = false; - // CHECKME: Shoud we keep the asserts here or should we even reset schema/catalog here - assert schemaState != SCHEMA_CATALOG_CHANGED : "connection is in the wrong state (not properly closed)"; - if (schemaState == SCHEMA_CATALOG_KNOWN) { - assert originalSchema.equals(getSchema()) : "connection is in the wrong schema: " + getSchema() + ", expected: " + originalSchema; - } - assert catalogState != SCHEMA_CATALOG_CHANGED : "connection is in the wrong state (not properly closed)"; - if (catalogState == SCHEMA_CATALOG_KNOWN) { - assert originalCatalog.equals(getCatalog()) : "connection is in the wrong catalog: " + getCatalog() + ", expected: " + originalCatalog; - } } /** diff --git a/ebean-datasource/src/test/java/io/ebean/datasource/test/PostgresInitTest.java b/ebean-datasource/src/test/java/io/ebean/datasource/test/PostgresInitTest.java index d8a8f16..e330b22 100644 --- a/ebean-datasource/src/test/java/io/ebean/datasource/test/PostgresInitTest.java +++ b/ebean-datasource/src/test/java/io/ebean/datasource/test/PostgresInitTest.java @@ -81,7 +81,7 @@ void test_with_clientInfo() throws SQLException { void test_with_applicationNameAndSchema() throws SQLException { DataSourceConfig ds = new DataSourceConfig(); ds.setUrl("jdbc:postgresql://127.0.0.1:9999/app"); - ds.setSchema("fred"); + ds.setSchema("public"); ds.setUsername("db_owner"); ds.setPassword("test"); ds.setApplicationName("my-application-name"); @@ -112,7 +112,7 @@ void test_with_applicationNameAndSchema() throws SQLException { void test_password2() throws SQLException { DataSourceConfig ds = new DataSourceConfig(); ds.setUrl("jdbc:postgresql://127.0.0.1:9999/app"); - ds.setSchema("fred"); + ds.setSchema("public"); ds.setUsername("db_owner"); ds.setPassword("test"); ds.setPassword2("newRolledPassword");