Announcement Announcement Module
Collapse
No announcement yet.
SQLException Using OracleLobHandler Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQLException Using OracleLobHandler

    In the interests of brevity, I won't post all my config files here, but if anyone thinks it will help I'd be glad to expand on them.

    Oracle: 10.1.0.3
    Hibernate: 3.0.5
    Spring: 1.2.1

    I'm storing an Image as a BLOB in the database, the property mapping in hibernate looks like this:

    Code:
    <property name="_data" 
                   column="image_data"
                   type="org.springframework.orm.hibernate3.support.BlobByteArrayType" 
                   access="field"/>
    I can read and write the data into this column just fine, but everytime I write to it, the following stack trace appears. It looks to me like this should get called before the connection is closed, but that it's actually getting called after the fact:

    ERROR 2005-07-06 20:12:19,973 org.springframework.jdbc.support.lob.OracleLobHand ler - Could not free Oracle LOB
    java.sql.SQLException: Must be logged on to server
    at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:125)
    at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:162)
    at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:227)
    at oracle.jdbc.driver.T4CConnection.assertLoggedOn(T4 CConnection.java:2425)
    at oracle.jdbc.driver.T4CConnection.freeTemporary(T4C Connection.java:1647)
    at oracle.sql.BLOB.freeTemporary(BLOB.java:581)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.springframework.jdbc.support.lob.OracleLobHand ler$OracleLobCreator.close(OracleLobHandler.java:3 97)
    at org.springframework.orm.hibernate3.support.Abstrac tLobType$SpringLobCreatorSynchronization.afterComp letion(AbstractLobType.java:281)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.triggerAfterCompletion(Ab stractPlatformTransactionManager.java:576)
    at org.springframework.transaction.support.AbstractPl atformTransactionManager.commit(AbstractPlatformTr ansactionManager.java:433)
    at org.springframework.transaction.interceptor.Transa ctionAspectSupport.doCommitTransactionAfterReturni ng(TransactionAspectSupport.java:260)
    at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:67)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :144)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:174)
    at $Proxy10.addGraphicToPlaylist(Unknown Source)
    I turned on a lot of logging, this is what appears prior to the error:

    DEBUG 2005-07-06 20:12:19,802 org.springframework.jdbc.support.lob.OracleLobHand ler - Created new Oracle LOB
    DEBUG 2005-07-06 20:12:19,833 org.springframework.jdbc.support.lob.OracleLobHand ler - Set bytes for Oracle BLOB with length 7868
    DEBUG 2005-07-06 20:12:19,833 org.springframework.orm.hibernate3.support.BlobByt eArrayType - Registering Spring transaction synchronization for Hibernate LOB type
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.jdbc.AbstractBatcher - closing statement
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.persister.collection.AbstractCollect ionPersister - Deleting rows of collection: [net.ruckus.domain.user.Playlist.mItems#3927]
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.persister.collection.AbstractCollect ionPersister - no rows to delete
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.persister.collection.AbstractCollect ionPersister - Updating rows of collection: net.ruckus.domain.user.Playlist.mItems#3927
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.persister.collection.AbstractCollect ionPersister - done updating rows: 0 updated
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.persister.collection.AbstractCollect ionPersister - Inserting rows of collection: [net.ruckus.domain.user.Playlist.mItems#3927]
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.persister.collection.AbstractCollect ionPersister - done inserting rows: 0 inserted
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.event.def.AbstractFlushingEventListe ner - post flush
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.jdbc.JDBCContext - before transaction completion
    DEBUG 2005-07-06 20:12:19,880 org.hibernate.impl.SessionImpl - before transaction completion
    DEBUG 2005-07-06 20:12:19,926 org.hibernate.transaction.JDBCTransaction - re-enabling autocommit
    DEBUG 2005-07-06 20:12:19,926 org.hibernate.transaction.JDBCTransaction - committed JDBC Connection
    DEBUG 2005-07-06 20:12:19,926 org.hibernate.jdbc.JDBCContext - after transaction completion
    DEBUG 2005-07-06 20:12:19,926 org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
    DEBUG 2005-07-06 20:12:19,926 org.hibernate.jdbc.ConnectionManager - closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
    DEBUG 2005-07-06 20:12:19,958 org.hibernate.impl.SessionImpl - after transaction completion
    DEBUG 2005-07-06 20:12:19,973 org.springframework.orm.hibernate3.HibernateTransa ctionManager - Triggering afterCompletion synchronization
    Just in case it is relevant, this is on Weblogic 8.1.3 and I use the following native jdbc extractor:

    Code:
      <bean name="nativeJdbcExtractor"
            class="org.springframework.jdbc.support.nativejdbc.WebLogicNativeJdbcExtractor"/>
    Any suggestions would be very helpful.
    thanks

  • #2
    Just in case anyone else happened to see this behavior, upgrading to Spring 1.2.2 appears to have solved it.

    Comment


    • #3
      I was wondering - I have to do the *exact* same thing in my code. Can you show me the snippet to read and write the binary data that you have in your DAO?

      Comment


      • #4
        I just have a byte[] in my domain object:

        Code:
        private byte&#91;&#93; _data;
        And map it with the spring user type

        Code:
          <property name="_data" 
                    column="image_data" 
                    type="org.springframework.orm.hibernate3.support.BlobByteArrayType" 
                    access="field"/>
        I don't do anything special after that... just treat it like any other property.

        Comment


        • #5
          GOT it.. thanks... How do you have your LocalSessionFactoryBean configured? I'm having errors trying to set the jtaTransactionManager property to use a WebLogicJtaTransactionManager.

          Comment


          • #6
            I don't use JTA so I don't think I'd be much help

            Comment


            • #7
              Really??? What are you using then??

              Comment


              • #8
                In my spring config:

                Code:
                <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</prop>

                Comment

                Working...
                X