-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: contextual LOB creation as createClob() method threw error
PostPosted: Wed May 02, 2012 2:31 am 
Newbie

Joined: Wed May 02, 2012 2:16 am
Posts: 1
I am trying to use JPA to insert a record on a table hosted on Oracle using standalone java program.
I am using Eclipse Indigo, Hibernate version - 4.1.2 & Oracle Database 10g Enterprise Edition Release 10.2.0.5.0.

I am able to insert the data successfully, however the following exception is thrown.

May 1, 2012 11:11:41 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException


The table that I am inserting into does not contain any CLOB column.

Following is the snippet of "persistence.xml"

<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
<description>Test Persistence Unit</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.test.persistence.PersistenceBean</class>

<properties>

<property name="hibernate.connection.username" value="user_name" />
<property name="hibernate.connection.password" value="password" />
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@<server_name>:<port>:<sid>" />
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.default_schema" value="<default_schema_name>" />

</properties>

</persistence-unit>

Following is the snapshot of the log -


May 1, 2012 11:11:39 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
May 1, 2012 11:11:39 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.2.Final}
May 1, 2012 11:11:39 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
May 1, 2012 11:11:39 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
May 1, 2012 11:11:39 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
May 1, 2012 11:11:39 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
May 1, 2012 11:11:39 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: true
May 1, 2012 11:11:39 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [oracle.jdbc.driver.OracleDriver] at URL [jdbc:oracle:thin:@<server_name>:port:sid]
May 1, 2012 11:11:39 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user=<user_name>, password=****, autocommit=true, release_mode=auto}
May 1, 2012 11:11:41 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.Oracle10gDialect
May 1, 2012 11:11:41 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
May 1, 2012 11:11:41 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
May 1, 2012 11:11:41 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory


Top
 Profile  
 
 Post subject: Re: contextual LOB creation as createClob() method threw error
PostPosted: Wed May 21, 2014 5:52 pm 
Newbie

Joined: Thu Mar 28, 2013 11:06 am
Posts: 8
Hi,

in 4.3:
org.hibernate.engine.jdbc.internal.LobCreatorBuilder.java, line 112 is the reason of your "problem"

Code:
starting from line 108:
            // If we get here we are running in a jdk 1.6 (jdbc 4) environment...
            // Further check to make sure the driver actually implements the LOB creation methods.  We
            // check against createClob() as indicative of all; should we check against all 3 explicitly?
            try {
               final Object clob = createClobMethod.invoke( jdbcConnection, NO_ARGS );
               try {
                  final Method freeMethod = clob.getClass().getMethod( "free", NO_ARG_SIG );
                  freeMethod.invoke( clob, NO_ARGS );
               }
               catch ( Throwable ignore ) {
                  LOG.tracef( "Unable to free CLOB created to test createClob() implementation : %s", ignore );
               }
               return true;
            }
            catch ( Throwable t ) {
               LOG.disablingContextualLOBCreationSinceCreateClobFailed( t );
            }


Maybe someone can explain, why I've have to disable this with
hibernate.jdbc.lob.non_contextual_creation=true
even it is obvious because I'm using mysql connector.

Best regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.