Uploaded image for project: 'Spring Social'
  1. Spring Social
  2. SOCIAL-384

JdbcConnectionRepository class conflicts with spring transaction management

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.0.3.RELEASE, 1.1.0.M3
    • Fix Version/s: None
    • Component/s: Connection Persistence
    • Environment:
      Spring 3.2.1
      Spring security 3.1.4
      spring data jpa 1.3.3

      Description

      I'm developing an application that uses spring social to integrate with facebook application. My data layer is using spring data jpa and a usual LocalContainerEntityManagerFactoryBean.

      The problem is that every transactional method that actively uses the facebook connection can't be executed because the JdbcConnectionRepository that uses the same datasource closes the connection and hence everything fails.

      The Exception raised is:

      [org.springframework.transaction.interceptor.TransactionInterceptor.completeTransactionAfterThrowing:408] Application exception overridden by rollback exception
      org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [insert into ....]; SQL state [null]; error code [0]; could not prepare statement; nested exception is org.hibernate.exception.GenericJDBCException: could not prepare statement
      at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:651)
      ...
      Caused by: org.hibernate.exception.GenericJDBCException: could not prepare statement
      at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)
      ...
      Caused by: java.sql.SQLException: Connection is closed.
      at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.checkOpen(PoolingDataSource.java:185)

      As a workaround I created a new connection pooler using a duplicate datasource, but it's a worthless complication and an integration with the usual transaction mechanism managed by spring would be ideal.

        Attachments

          Activity

            People

            Assignee:
            habuma Craig Walls
            Reporter:
            dusty Alex
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: