خرید بک لینک

Vote count: 0

We are currently facing an issue with hibeate unit testing. Using Hibeate + JPA + Spring + junit + Maven + below is the persistence configuration:

<persistence-unit name="localContainerEntityForTest">
    <description>Spring JPA LocalContainerEntityManagerFactoryBean</description>
    <provider>org.hibeate.ejb.HibeatePersistence</provider>
    <properties>
        <property name="hibeate.dialect" value="org.hibeate.dialect.MySQLDialect"/>
        <property name="hibeate.hbm2ddl.auto" value="create"/>
        <property name="hibeate.implicit_naming_strategy" value="legacy-jpa"/>
        <property name="hibeate.show_sql" value="true" />
        <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
        <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/ourServerApp?createDatabaseIfNotExist=true"/>
        <property name="javax.persistence.jdbc.user" value="hibeate"/>
        <property name="javax.persistence.jdbc.password" value="password"/>
    </properties>
</persistence-unit>

One of the developers created an unit-test and hibeate simply blocks at one insert statement. No errors, no logs, except the following in console:

Hibeate: insert into role (details, name) values (?, ?)
Hibeate: insert into permission (details, name, state) values (?, ?, ?)
Hibeate: insert into role_permission (permission_id, role_id) values (?, ?)

Blocks at the last one. On the author's machine (the one who created the unit test) all is well and working, unit test passing. But on other developer machines the test simply blocks at this statement. We are not able to find out why this happens. It seems that this is a database lock issue, but not sure.

Why this might happen and how we can figure out what's wrong?

P.S. Same MySQL version, tomcat, source up to date.

asked 4 mins ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 15 ارديبهشت 1395 ساعت: 15:45

صفحه بندی