File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
hibernate-core/src/main/java/org/hibernate/internal Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -716,17 +716,20 @@ private String tenantSchema() {
716716 return tenantSchemaMapper == null ? null : tenantSchemaMapper .schemaName ( tenantIdentifier );
717717 }
718718
719+ private transient String initialSchema ;
720+
719721 @ Override
720722 public void afterObtainConnection (Connection connection ) throws SQLException {
721723 if ( useSchemaBasedMultiTenancy () ) {
724+ initialSchema = connection .getSchema ();
722725 connection .setSchema ( tenantSchema () );
723726 }
724727 }
725728
726729 @ Override
727730 public void beforeReleaseConnection (Connection connection ) throws SQLException {
728731 if ( useSchemaBasedMultiTenancy () ) {
729- connection .setSchema ( null );
732+ connection .setSchema ( initialSchema );
730733 }
731734 }
732735
You can’t perform that action at this time.
0 commit comments