Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite DB locked when you specify flywayDriver #1318

Closed
reactormonk opened this issue May 21, 2016 · 3 comments
Closed

sqlite DB locked when you specify flywayDriver #1318

reactormonk opened this issue May 21, 2016 · 3 comments

Comments

@reactormonk
Copy link

@reactormonk reactormonk commented May 21, 2016

What version of Flyway are you using?

4.0.1

What database are you using (type & version)?

sqlite / xerial / 3.8.11.2

What operating system are you using?

Linux

What did you do?
libraryDependencies ++= Seq(
  "org.xerial" % "sqlite-jdbc" % "3.8.11.2"
)

flywayUrl := "jdbc:sqlite:buddy.db"
flywayDriver := "org.sqlite.JDBC"

With a random migration, e.g.

create table user
(
  id integer primary key,
);

Then run

sbt flywayMigrate
What did you expect to see?

Migration.

What did you see instead?
Caused by: java.sql.SQLException: database is locked

That only happens when I specify

flywayDriver := "org.sqlite.JDBC"

without it, it works just fine.

@kinow
Copy link

@kinow kinow commented Sep 27, 2016

Same was happening for me, saved by @axelfontaine 's comment about not setting the JDBC driver. That indeed fixed the issue for me.

Here's a simple example:
https://github.com/kinow/matchan/tree/277d1163016594279bf575d69ac62a95e94c2b8e/databases/reminders

Checking out that directory, and running flyway migrate will create a database.sqlite in the current directory. If you edit flyway.conf, uncommenting the driver, you'll get the error.

Thanks @axelfontaine !

@kinow
Copy link

@kinow kinow commented Sep 29, 2016

Checked out the latest code, used instructions in this SO question to build the project, then in Eclipse copied the original installation drivers and jars directories over to flyway-commandline maven module.

Was ready to debug the issue, but actually, when I run the migrate command with the same scenario, it works.

So I believe it has been fixed in the -trunk- master already :-)

My checkout revision: 8b9dbfa

Hope that helps.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Jan 25, 2017

This has now been fixed as part of #1499 (see my comment on that issue for the cause)

Thanks for investigating!

axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants