Results 1 to 8 of 8

Thread: SQLException Using OracleLobHandler

  1. #1
    Join Date
    Jul 2005
    Posts
    6

    Default 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. #2
    Join Date
    Jul 2005
    Posts
    6

    Default

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

  3. #3
    Join Date
    Aug 2004
    Location
    Tacoma, WA USA
    Posts
    49

    Default

    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?
    ElPapa

    The delusion that people care about what I think:
    http://www.codethought.com/blog

  4. #4
    Join Date
    Jul 2005
    Posts
    6

    Default

    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.

  5. #5
    Join Date
    Aug 2004
    Location
    Tacoma, WA USA
    Posts
    49

    Default

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

    The delusion that people care about what I think:
    http://www.codethought.com/blog

  6. #6
    Join Date
    Jul 2005
    Posts
    6

    Default

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

  7. #7
    Join Date
    Aug 2004
    Location
    Tacoma, WA USA
    Posts
    49

    Default

    Really??? What are you using then??
    ElPapa

    The delusion that people care about what I think:
    http://www.codethought.com/blog

  8. #8
    Join Date
    Jul 2005
    Posts
    6

    Default

    In my spring config:

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

Similar Threads

  1. Replies: 5
    Last Post: Sep 11th, 2006, 04:00 PM
  2. Replies: 7
    Last Post: Aug 18th, 2005, 02:41 PM
  3. Unable to translate SQLException
    By timwu1616 in forum Data
    Replies: 1
    Last Post: May 18th, 2005, 02:25 PM
  4. Replies: 2
    Last Post: Apr 25th, 2005, 11:19 PM
  5. Replies: 6
    Last Post: Jan 14th, 2005, 08:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •