Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed #746: Unhelpful error when forgetting "flyway.driver" with xeri…
…al sqlite-jdbc
  • Loading branch information
Axel Fontaine committed May 2, 2014
1 parent ab064ef commit 9c57e9a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Expand Up @@ -281,6 +281,7 @@ protected Connection getConnectionFromDriver(String username, String password) t
InvocationHandler suppressCloseHandler = new SuppressCloseHandler(connection);
singleConnection =
(Connection) Proxy.newProxyInstance(classLoader, new Class[] {Connection.class}, suppressCloseHandler);
return singleConnection;
}

return connection;
Expand Down
Expand Up @@ -16,6 +16,7 @@
package org.flywaydb.core.internal.dbsupport.sqlite;

import org.flywaydb.core.DbCategory;
import org.flywaydb.core.Flyway;
import org.flywaydb.core.migration.MigrationTestCase;
import org.flywaydb.core.internal.util.jdbc.DriverDataSource;
import org.junit.Ignore;
Expand Down Expand Up @@ -58,4 +59,21 @@ public void trigger() throws Exception {
flyway.clean();
flyway.migrate();
}

@Test
public void noDriverCrashIssue746() throws Exception {
flyway.setLocations(BASEDIR);

Properties props = new Properties();
//uncomment this to fix the code
//props.setProperty("flyway.driver", "org.sqlite.JDBC");
props.setProperty("flyway.url", "jdbc:sqlite::memory:");
props.setProperty("flyway.user", "sa");
flyway.configure(props);

//first invocation works fine
flyway.info();
//here comes the crash
flyway.migrate();
}
}

0 comments on commit 9c57e9a

Please sign in to comment.