Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7733689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:03:56+00:00 2026-06-01T07:03:56+00:00

play framework: 1.2.3 Hi, I am trying to purge my database by using play’s

  • 0

play framework: 1.2.3

Hi,

I am trying to purge my database by using play’s fixtures. However, I run into some problems trying that.

First, Fixtures.deleteDatabase() deletes the whole database and play does not recreate it on another test (also I haven’t found nothing to do so.

Second, trying to deleteAllModules() I get an exception for any model play is trying to delete:

java.sql.SQLException: Lock wait timeout exceeded; try restarting 

These models have been created during the test using the normal Model.save(). I suppose that – once again – transactions come into my way somehow. However, looking at the database, all models get persisted.

@After
public void tearDown() throws InterruptedException, ExecutionException {
    new Job() {
        @Override
        public void doJob() throws Exception {
            Logger.debug("[SetupUtils.createClearDBJob().new Job() {...}] Deleting database");
            Fixtures.deleteAllModels();
            //              Fixtures.delete()
            //              Fixtures.deleteDatabase();
        }
    }.now().get();
}

Full-Stacktrace

ERROR 563 :play#niceThrowable - While deleting class models.DropboxFolder instances
    javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute update query
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1214)
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147)
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1224)
    at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:108)
    at play.db.jpa.JPAPlugin$JPAModelLoader.deleteAll(JPAPlugin.java:478)
    at play.test.Fixtures.delete(Fixtures.java:72)
    at play.test.Fixtures.delete(Fixtures.java:92)
    at play.test.Fixtures.deleteAllModels(Fixtures.java:104)
    at mashpan.utilities.SetupUtils$2.doJob(SetupUtils.java:44)
    at play.jobs.Job.doJobWithResult(Job.java:50)
    at play.jobs.Job.call(Job.java:146)
    at play.jobs.Job$1.call(Job.java:66)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)
Caused by: org.hibernate.exception.GenericJDBCException: could not execute update query
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:110)
    at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:421)
    at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:283)
    at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1288)
    at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:117)
    at org.hibernate.ejb.QueryImpl.internalExecuteUpdate(QueryImpl.java:188)
    at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:99)
    ... 15 more
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
    at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:101)
    ... 21 more
ERROR 563 :play#niceThrowable - While deleting class models.User instances
    javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute update query
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1214)
    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147)
    at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1224)
    at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:108)
    at play.db.jpa.JPAPlugin$JPAModelLoader.deleteAll(JPAPlugin.java:478)
    at play.test.Fixtures.delete(Fixtures.java:72)
    at play.test.Fixtures.delete(Fixtures.java:92)
    at play.test.Fixtures.deleteAllModels(Fixtures.java:104)
    at mashpan.utilities.SetupUtils$2.doJob(SetupUtils.java:44)
    at play.jobs.Job.doJobWithResult(Job.java:50)
    at play.jobs.Job.call(Job.java:146)
    at play.jobs.Job$1.call(Job.java:66)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at 


java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)
Caused by: org.hibernate.exception.GenericJDBCException: could not execute update query
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
    at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:110)
    at org.hibernate.hql.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:421)
    at org.hibernate.engine.query.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:283)
    at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1288)
    at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:117)
    at org.hibernate.ejb.QueryImpl.internalExecuteUpdate(QueryImpl.java:188)
    at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:99)
    ... 15 more
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
    at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
    at org.hibernate.hql.ast.exec.BasicExecutor.execute(BasicExecutor.java:101)
    ... 21 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:03:58+00:00Added an answer on June 1, 2026 at 7:03 am

    You can try to set the create/delete operaton in the Bootstrap, and to check if Play! is running in test mode or production mode.

    @OnApplicationStart
    public class Bootstrap extends Job {
    
      public void doJob() {
        if (Play.mode == Play.Mode.DEV) {
            DropboxFolder.deleteAll(); // delete 
            Fixtures.load("samples_data.yml"); // recreate 
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small site I built using the Play framework that I'm trying
I am trying to run 2 projects built using play framework simultaneously but with
I'm trying to test a model method using Play Framework 2.0 and Specs2. Global.scala
I'm new to Play framework. I'm trying to configure MySQL database as a datasource
I'm developing a web app using the play! framework and morphia/mongodb. I'm trying to
I've been trying to create a Web Service with play framework. I've searched some
I am trying to perform some custom validation with play framework but I don't
I'm trying to save a record with JsonObjectField (using lift-mongo- record in Play framework)
I am trying to use Informix database with a Play! Framework application. I am
I'm trying to port some code from Play Framework Java to Play Framework Scala

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.