File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/java/io/ebean/datasource/pool Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -318,12 +318,15 @@ private void initialiseDatabase() throws SQLException {
318318 // successfully obtained a connection so skip initDatabase
319319 connection .clearWarnings ();
320320 } catch (SQLException e ) {
321+ logger .info ("Obtaining connection using ownerUsername:{} to initialise database" , config .getOwnerUsername ());
321322 // expected when user does not exists, obtain a connection using owner credentials
322- try (Connection connection = createUnpooledConnection (config .getOwnerUsername (), config .getOwnerPassword ())) {
323+ try (Connection ownerConnection = createUnpooledConnection (config .getOwnerUsername (), config .getOwnerPassword ())) {
323324 // initialise the DB (typically create the user/role using the owner credentials etc)
324325 InitDatabase initDatabase = config .getInitDatabase ();
325- initDatabase .run (connection , config );
326- connection .commit ();
326+ initDatabase .run (ownerConnection , config );
327+ ownerConnection .commit ();
328+ } catch (SQLException e2 ) {
329+ throw new SQLException ("Failed to run InitDatabase with ownerUsername:" + config .getOwnerUsername (), e2 );
327330 }
328331 }
329332 }
You can’t perform that action at this time.
0 commit comments