#590 ✓wontfix
Michael Carl

Error loading fixtures upfront functional test

Reported by Michael Carl | February 9th, 2011 @ 05:36 PM

Framework version: 1.2 (latest from git repository)
Platform you're using: Windows 7

Reproduction steps:

Set up a test case like:

public void setupFixtures() throws Exception {

 * Test login with valid credentials.
public void testLoginWithValidCredentials() {
    // do some POST request here


If having a FunctionalTest set up the way shown above and running it either from eclipse or via the web based way I receive the following error:

18:28:09,883 WARN ~ You're running Play! in DEV mode
18:28:11,280 INFO ~ Connected to jdbc:h2:mem:play;MODE=MYSQL
18:28:12,066 INFO ~ Application 'XXXXX' is now started !
18:28:14,784 WARN ~ SQL Error: 50200, SQLState: HYT00
18:28:14,784 ERROR ~ Timeout trying to lock table "USER"; SQL statement: select count(user0.id) as col_0_0 from User user0_ limit ? [50200-149]

The fixtures file contains data for USER table.

Comments and changes to this ticket

  • Michael Carl

    Michael Carl February 9th, 2011 @ 05:40 PM

    The full stacktrace:

    org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "USER"; SQL statement:
    select count(user0_.id) as col_0_0_ from User user0_ limit ? [50200-149]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
        at org.h2.message.DbException.get(DbException.java:167)
        at org.h2.message.DbException.get(DbException.java:144)
        at org.h2.table.RegularTable.doLock(RegularTable.java:499)
        at org.h2.table.RegularTable.lock(RegularTable.java:433)
        at org.h2.table.TableFilter.lock(TableFilter.java:140)
        at org.h2.command.dml.Select.queryWithoutCache(Select.java:571)
        at org.h2.command.dml.Query.query(Query.java:257)
        at org.h2.command.dml.Query.query(Query.java:227)
        at org.h2.command.CommandContainer.query(CommandContainer.java:78)
        at org.h2.command.Command.executeQuery(Command.java:178)
        at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:96)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
        at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
        at org.hibernate.loader.Loader.doQuery(Loader.java:802)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
        at org.hibernate.loader.Loader.doList(Loader.java:2533)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
        at org.hibernate.loader.Loader.list(Loader.java:2271)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
        at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
        at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
        at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:274)
        at play.db.jpa.JPQL.count(JPQL.java:20)
        at models.account.User.count(User.java)
        at models.account.User.isValidLogin(User.java:98)
        at controllers.Authentication.login(Authentication.java:26)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:506)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:464)
        at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:440)
        at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:435)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:160)
        at play.test.FunctionalTest$1.execute(FunctionalTest.java:265)
        at play.Invoker$Invocation.run(Invoker.java:257)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
  • Nicholas C. Zakas

    Nicholas C. Zakas May 11th, 2011 @ 01:16 AM

    I'm getting this too. Any updates?

  • Cyril

    Cyril June 6th, 2011 @ 03:46 PM

    Have this problem too!

    (Fedora 15 beta, Play 1.2)

    I tested to load a model within the Test, it worked, but through the POST request, it fails!

  • Cyril

    Cyril June 6th, 2011 @ 03:56 PM

    • no changes were found...
  • Morten Kjetland

    Morten Kjetland June 9th, 2011 @ 07:28 PM

    • State changed from “new” to “wontfix”
    • Assigned user set to “Morten Kjetland”

    See "migration" in release note for Play 1.2 http://www.playframework.org/documentation/1.2.1/releasenotes-1.2

    You should configure your db with READ_UNCOMMITED when running functional tests

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2>Play framework</h2>

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the <a href="http://www.playframework.org">http://www.playframework.org</a> website.<br><br>

<h2>Source code is hosted on github</h2>Check out our repository at <a href="http://github.com/playframework/play">http://github.com/playframework/play</a><br><br>

<h2>Contributing, creating a patch</h2> Please read the <a href="http://play.lighthouseapp.com/projects/57987/contributor-guide">contributor guide</a><br><br>

<h2>Reporting Security Vulnerabilities</h2> Since all bug reports are public, please report any security vulnerability directly to <em>guillaume dot bort at gmail dot com</em>.<br><br>

<h2>Creating a bug report</h2> Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.<br><br>

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.<br><br>

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.

Referenced by