RestComm / jain-slee

The World's #1 Open Source JAIN-SLEE (JSLEE) 1.1 Implementation
http://www.restcomm.com/
GNU Affero General Public License v3.0
25 stars 50 forks source link

[tck] H2: Unique index or primary key violation #88

Closed SergeyLee closed 7 years ago

SergeyLee commented 7 years ago

I have error with test: tests/profiles/profileverification/ProfileVerificationTest.xml.

It contains three tests at the end:

        getLog().info("Set table2 to two non-unique values");
        proxy.editProfile();
        proxy.setTable2(new String[]{"one", "one"});
        proxy.commitProfile();
        getLog().info("Set table1 to two unique values");
        proxy.editProfile();
        proxy.setTable1(new String[]{"one", "two"});
        proxy.commitProfile();
        getLog().info("Set table1 to two non-unique values");
        proxy.editProfile();
        proxy.setTable1(new String[]{"one", "one"});
        try {
            proxy.commitProfile();
            Assert.fail(4368, "Expected javax.slee.ProfileVerificationException not thrown when unique indexed attribute contains duplicate entries");
        } catch (ProfileVerificationException e) { }

In the last test when it commits Profile I have error:

12:09:18,295 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (RMI TCP Connection(7)-127.0.0.1) SQL Error: 23505, SQLState: 23505 12:09:18,295 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (RMI TCP Connection(7)-127.0.0.1) Unique index or primary key violation: "UK9TJQBOOTL79LCTTF051WX54VI_INDEX_3 ON PUBLIC.SLEE_PEAAV_INDEXEDPROFILECMP_1034408531TABLE1(OWNER_TABLENAME, STRING) VALUES ('tck.ProfileVerificationTest.table', 'one', 3)"; SQL statement: insert into SLEE_PEAAV_IndexedProfileCMP_1034408531table1 (owner_profileName, owner_tableName, serializable, string, id) values (?, ?, ?, ?, ?) [23505-193]

and call stack for this error:

Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "UK9TJQBOOTL79LCTTF051WX54VI_INDEX_3 ON PUBLIC.SLEE_PEAAV_INDEXEDPROFILECMP_1034408531TABLE1(OWNER_TABLENAME, STRING) VALUES ('tck.ProfileVerificationTest.table', 'one', 3)"; SQL statement: insert into SLEE_PEAAV_IndexedProfileCMP_1034408531table1 (owner_profileName, owner_tableName, serializable, string, id) values (?, ?, ?, ?, ?) [23505-193] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) at org.h2.message.DbException.get(DbException.java:179) at org.h2.message.DbException.get(DbException.java:155) at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103) at org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:231) at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:190) at org.h2.mvstore.db.MVTable.addRow(MVTable.java:704) at org.h2.command.dml.Insert.insertRows(Insert.java:156) at org.h2.command.dml.Insert.update(Insert.java:114) at org.h2.command.CommandContainer.update(CommandContainer.java:98) at org.h2.command.Command.executeUpdate(Command.java:258) at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:160) at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:146) at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:537) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204)

So I have several questions:

brainslog commented 7 years ago

@SergeyLee, isn't that the expected result for the test ? It expects it to fail due to unique constraint being violated. I think it's just missing being properly wrapped as a javax.slee.ProfileVerificationException.

SergeyLee commented 7 years ago

Yes, I found solution 2 days ago. Problem was on TCK client side and I added some dependencies into ant build.xml. So this issue is solved! :)

cgopi commented 5 years ago

How the problem is solved? Can you please let me know what dependencies are added?

dsha256 commented 3 years ago

@SergeyLee I have the same problem. What dependencies did you add? Thanks!