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 8002275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:18:37+00:00 2026-06-04T16:18:37+00:00

we are running Junit ans Selenium test cases from CI every midnight. We are

  • 0

we are running Junit ans Selenium test cases from CI every midnight. We are pre populating the data using the Maven-SQL plugin as following.

          <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>sql-maven-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <id>create-database-tables</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <autocommit>false</autocommit>
                            <onError>continue</onError>
                            <srcFiles>
                                <srcFile>../sql/delete_data.sql</srcFile>
                                <srcFile>../sql/load_data.sql</srcFile>
                            </srcFiles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

we are frequently facing the DB deadlocks due to simultaneous builds by different users. The solution we thought is to lock the database before running the DB scripts.

Can we lock the DB access before running the scripts and unlock it after running the scripts.

  • 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-04T16:18:39+00:00Added an answer on June 4, 2026 at 4:18 pm

    A shared database for testing is never a great idea, presumably you know this which is why you’re asking how to restrict access to one user at a time.

    Preaching aside….. I’d like to offer a left-field solution of liquibase to manage both the database schema and data population. Has lots of useful features one of which is that it will automatically lock the database and prevent two instance of liquibase interfering with each other.

    Example

    <project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>com.myspotontheweb.db</groupId>
        <artifactId>liquibase-demo</artifactId>
        <version>1.0-SNAPSHOT</version>
        <properties>
            <!-- Liquibase settings -->
            <liquibase.url>jdbc:h2:target/db1/liquibaseTest;AUTO_SERVER=TRUE</liquibase.url>
            <liquibase.driver>org.h2.Driver</liquibase.driver>
            <liquibase.username>user</liquibase.username>
            <liquibase.password>pass</liquibase.password>
            <liquibase.changeLogFile>com/myspotontheweb/db/changelog/db-changelog-master.xml</liquibase.changeLogFile>
            <liquibase.promptOnNonLocalDatabase>false</liquibase.promptOnNonLocalDatabase>
        </properties>
        <dependencies>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.3.162</version>
            </dependency>
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.liquibase</groupId>
                    <artifactId>liquibase-maven-plugin</artifactId>
                    <version>2.0.2</version>
                    <executions>
                        <execution>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>update</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using data-driven test suites running JUnit 3 based on Rainsberger's JUnit Recipes
Running the Java Compiler from a JUnit test is pretty simple using the Java
I am using JUnit 4.10 for running test suites, and I have implemented a
I'm using JUnit 4.4 and Maven and I have a large number of long-running
I'm running some JUnit tests on my applications. Every test has a for loop
Possible Duplicate: Running junit tests in parallel? I found the test cases inside jUnit
I am running Junit tests from Maven. The ant script has <junit failureproperty=failproperty errorproperty=errorproperty>
When I am running a junit test from ant I always get: D:\metrike>ant test
I'm remotely running a JUnit test suite with Ant from my local machine to
Running Mac OS X 10.5.8, with PHP 5.2.11 Pre-installed. Using Coda 1.6.10. I'm writing

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.