[JBoss JIRA] (ISPN-4072) JPA Cache Store fails to clear entity which contains ElementCollection
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/ISPN-4072?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration commented on ISPN-4072:
-----------------------------------------------
Tristan Tarrant <ttarrant(a)redhat.com> changed the Status of [bug 1091901|https://bugzilla.redhat.com/show_bug.cgi?id=1091901] from NEW to CLOSED
> JPA Cache Store fails to clear entity which contains ElementCollection
> ----------------------------------------------------------------------
>
> Key: ISPN-4072
> URL: https://issues.jboss.org/browse/ISPN-4072
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Reporter: Vojtech Juranek
> Assignee: Vojtech Juranek
> Labels: 630
> Fix For: 7.0.0.Alpha2, 7.0.0.Final
>
>
> When entity stored by JPA Cache Store contains [ElementCollection|http://docs.oracle.com/javaee/6/api/javax/persistence/E...], {{clear()}} operation fails with foreign key constraint violation.
> Stack trace in case of MySQL:
> {noformat}
> org.infinispan.persistence.jpa.JpaStoreException: Exception caught in clear()
> at org.infinispan.persistence.jpa.JpaStore.clear(JpaStore.java:143)
> at org.infinispan.persistence.jpa.BaseJpaStoreTest.setUp(BaseJpaStoreTest.java:85)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:744)
> Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
> at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1397)
> at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:108)
> at org.infinispan.persistence.jpa.JpaStore.clear(JpaStore.java:128)
> ... 23 more
> Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
> at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:74)
> at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
> at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
> at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
> at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:136)
> at org.hibernate.hql.internal.ast.exec.BasicExecutor.execute(BasicExecutor.java:103)
> at org.hibernate.hql.internal.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:413)
> at org.hibernate.engine.query.spi.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:282)
> at org.hibernate.internal.SessionImpl.executeUpdate(SessionImpl.java:1290)
> at org.hibernate.internal.QueryImpl.executeUpdate(QueryImpl.java:116)
> at org.hibernate.ejb.QueryImpl.internalExecuteUpdate(QueryImpl.java:194)
> at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:99)
> ... 24 more
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`ispn_jpa_test`.`Person_nickNames`, CONSTRAINT `FK_ne1r4l90nve6426b7c7ws198i` FOREIGN KEY (`Person_id`) REFERENCES `Person` (`id`))
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
> at com.mysql.jdbc.Util.getInstance(Util.java:386)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4098)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4030)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2677)
> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2134)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2434)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2352)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2337)
> at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133)
> ... 31 more
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 7 months
[JBoss JIRA] (ISPN-3953) JPACacheStore should not load all entities in memory
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/ISPN-3953?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration updated ISPN-3953:
------------------------------------------
Bugzilla Update: Perform
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1091901
> JPACacheStore should not load all entities in memory
> ----------------------------------------------------
>
> Key: ISPN-3953
> URL: https://issues.jboss.org/browse/ISPN-3953
> Project: Infinispan
> Issue Type: Enhancement
> Components: Loaders and Stores
> Reporter: Emmanuel Bernard
> Assignee: Radim Vansa
> Labels: 630
> Fix For: 7.0.0.Alpha3
>
>
> Today several methods use getResultList() and load either all keys or all entities for a given entity type in- memory at the same time.
> This will likely blow up for big tables.
> There are two solutions:
> ## Use Hibernate's specific features
> Hibernate ORM has a session.scroll() method that offers a FORWARD_ONLY scrollable result set. You can then load data and regularly (every 100?) clear the session before hitting the next result. This will diminish greatly the memory pressure.
> ## Use a window model
> get the number of entities in the table select count(*)
> Then use setFirstResult / setMaxResults to navigate the data with a sliding window and clear the session every time you move the window.
> This won't be as efficient as Hibernate ORM's specific approach but will do the work except on database that don't support the ability to start the results at the nth element. Look up Hibernate dialects for more info.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 7 months
[JBoss JIRA] (ISPN-4072) JPA Cache Store fails to clear entity which contains ElementCollection
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/ISPN-4072?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration updated ISPN-4072:
------------------------------------------
Bugzilla Update: Perform
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1091901
> JPA Cache Store fails to clear entity which contains ElementCollection
> ----------------------------------------------------------------------
>
> Key: ISPN-4072
> URL: https://issues.jboss.org/browse/ISPN-4072
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Reporter: Vojtech Juranek
> Assignee: Vojtech Juranek
> Labels: 630
> Fix For: 7.0.0.Alpha2, 7.0.0.Final
>
>
> When entity stored by JPA Cache Store contains [ElementCollection|http://docs.oracle.com/javaee/6/api/javax/persistence/E...], {{clear()}} operation fails with foreign key constraint violation.
> Stack trace in case of MySQL:
> {noformat}
> org.infinispan.persistence.jpa.JpaStoreException: Exception caught in clear()
> at org.infinispan.persistence.jpa.JpaStore.clear(JpaStore.java:143)
> at org.infinispan.persistence.jpa.BaseJpaStoreTest.setUp(BaseJpaStoreTest.java:85)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:744)
> Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)
> at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)
> at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1397)
> at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:108)
> at org.infinispan.persistence.jpa.JpaStore.clear(JpaStore.java:128)
> ... 23 more
> Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
> at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:74)
> at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
> at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125)
> at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:110)
> at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:136)
> at org.hibernate.hql.internal.ast.exec.BasicExecutor.execute(BasicExecutor.java:103)
> at org.hibernate.hql.internal.ast.QueryTranslatorImpl.executeUpdate(QueryTranslatorImpl.java:413)
> at org.hibernate.engine.query.spi.HQLQueryPlan.performExecuteUpdate(HQLQueryPlan.java:282)
> at org.hibernate.internal.SessionImpl.executeUpdate(SessionImpl.java:1290)
> at org.hibernate.internal.QueryImpl.executeUpdate(QueryImpl.java:116)
> at org.hibernate.ejb.QueryImpl.internalExecuteUpdate(QueryImpl.java:194)
> at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:99)
> ... 24 more
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`ispn_jpa_test`.`Person_nickNames`, CONSTRAINT `FK_ne1r4l90nve6426b7c7ws198i` FOREIGN KEY (`Person_id`) REFERENCES `Person` (`id`))
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
> at com.mysql.jdbc.Util.getInstance(Util.java:386)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1039)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4098)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4030)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2490)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2677)
> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2134)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2434)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2352)
> at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2337)
> at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:133)
> ... 31 more
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 7 months
[JBoss JIRA] (ISPN-4061) JPA Cache Store fails on Oracle, Postgres and MsSQL
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/ISPN-4061?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration updated ISPN-4061:
------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1081398, https://bugzilla.redhat.com/show_bug.cgi?id=1091901 (was: https://bugzilla.redhat.com/show_bug.cgi?id=1081398)
> JPA Cache Store fails on Oracle, Postgres and MsSQL
> ---------------------------------------------------
>
> Key: ISPN-4061
> URL: https://issues.jboss.org/browse/ISPN-4061
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Reporter: Vojtech Juranek
> Assignee: Vojtech Juranek
> Labels: 630
> Fix For: 7.0.0.Alpha2, 7.0.0.Final
>
>
> Current snapshot version of JPA Cache Store fails on Oracle (see [failed tests|https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/infinispan-jpa...] with stack traces), Postgres ([failed tests|https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/infinispan-jpa...]) and MsSQL ([failed tests|https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/infinispan-jpa...]).
> While in case of Oracle and Postgres the problem is probably in {{\_\_ispn_metadata\_\_}} table, in case of MsSQL problem is in "User" entity, as User is reserved name in MsSQL. Oracle has a problem with table starting with underscrore, in case of Postgres {{VARBINARY}} type used in {{\_\_ispn_metadata\_\_}} is not available in. In case of MsSQL I'm not completely sure if it's bug or if it should be handled by user.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 7 months