We encounter a stack overflow error while using @PreUpdate and @Restrict in conjuction with a PersistenPermissionResolver. We use the Subversion trunk of Seam 2.2.0 GA and Hibernate.
The stack overflow error occurs because of the following steps:
Until now, we worked with a workaround similar to:
@PreUpdate void preUpdate() { if (Identity.isSecurityEnabled() && Contexts.isSessionContextActive()) { EntityManager em = (EntityManager) Component.getInstance("entityManager"); FlushModeType flushModeType = em.getFlushMode(); em.setFlushMode(FlushModeType.COMMIT); try { Identity.instance().checkPermission(this, "update"); } finally { em.setFlushMode(flushModeType); } } }
By using this workaround we prevent triggering the flush before the select statement.
We can live with that workaround. However, @Restrict statements with EL are much more convenient than having the workaround spread all over our entities. In addition, the statements differ, which makes a entity-super-class inconvenient, too.
So far, we did not find another solution, neither in this forum nor via google.
Is there any solution to our problem? We appreciate any tips to solve this.
Thanks for your help
--Beat