Comment #13 on issue 597 by twr....@gmail.com: Persist Extension: UnitOfWork.begin() throws IllegalStateException when called multiple times
http://code.google.com/p/google-guice/issues/detail?id=597

I encountered the same issue with JpaPersistService.end() and would like it to be addressed. How likely is it that the fix suggested in the previous post would end up in a new release?

Problem:
If an exception is thrown in com.google.inject.persist.jpa.JpaPersistService.end() on em.close(), entityManager.remove() is not called.

When used from com.google.inject.persist.PersistFilter, this results in java.lang.IllegalStateException for every consequent invocation of the filter.

1) exception on em.close()
org.hibernate.exception.GenericJDBCException: Could not close connection
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) 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.LogicalConnectionImpl.releaseConnection(LogicalConnectionImpl.java:327) at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.close(LogicalConnectionImpl.java:199) at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.close(JdbcCoordinatorImpl.java:141) at org.hibernate.engine.transaction.internal.TransactionCoordinatorImpl.close(TransactionCoordinatorImpl.java:276)
        at org.hibernate.internal.SessionImpl.close(SessionImpl.java:352)
at org.hibernate.ejb.EntityManagerImpl.close(EntityManagerImpl.java:137) at com.google.inject.persist.jpa.JpaPersistService.end(JpaPersistService.java:81) at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:91)

2) exception on filter invocation
java.lang.IllegalStateException: Work already begun on this thread. Looks like you have called UnitOfWork.begin() twice without a balancing call to end() in between. at com.google.inject.internal.util.$Preconditions.checkState(Preconditions.java:142) at com.google.inject.persist.jpa.JpaPersistService.begin(JpaPersistService.java:66) at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:87)


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-guice-dev+unsubscr...@googlegroups.com.
To post to this group, send email to google-guice-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to