Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Modeling (top-level project) » Problem with CDO/Teneo/Hibernate on Derby
Problem with CDO/Teneo/Hibernate on Derby [message #611005] Fri, 19 September 2008 04:22
Roger Stocker is currently offline Roger Stocker
Messages: 16
Registered: July 2009
Junior Member
Hi

I ran into a problem when I use the TeneoHibernateMapping for CDO on
Apache Derby Embedded:
org.hibernate.exception.GenericJDBCException: could not insert:
[org.eclipse.emf.cdo.internal.common.model.CDOPackageImpl]
Caused by: org.apache.derby.iapi.services.io.DerbyIOException: A
truncation error was encountered trying to shrink CLOB 'XXXX' to length
255.
(below is a Stacktrace)

It happens when I commit the CDOTransaction after adding one eClass:

CDOSession session = configuration.openSession();
session.getPackageRegistry().putEPackage(PeoplePackage.eINST ANCE);

// Open transaction
CDOTransaction transaction = session.openTransaction();

transaction.setChangeSubscriptionPolicy(CDOChangeSubscriptio nPolicy.ALL);

CDOResource resource = transaction.createResource("/Test");

Person person = PeopleFactory.eINSTANCE.createPerson();
person.setFirstName("Hallo");
person.setLastName("Velo");
resource.getContents().add(person);

transaction.commit();


This is only happening with Derby Embedded, but not with Postgres. Also
using the storeType="db" is working with Derby.

My model is just a simple test model with 3 features (no relations).

Used Versions:
--------------
Eclipse SDK 3.4.1RC3
CDO 2.0.0-I200809110653
Net4j 2.0.0-I200809110620
Teneo 1.0.1-M200809150739
Derby 10.4.2


cdo-server.xml:
---------------
<?xml version="1.0" encoding="UTF-8"?>
<cdoServer>

<acceptor type="tcp" listenAddr="0.0.0.0" port="2036">
<!-- negotiator type="challenge" description="/temp/users.db"/ -->
</acceptor>

<repository name="HPROTO">
<property name="overrideUUID"
value="1ff5d226-b1f3-45fb-afa2-0c30b38c764f" />
<property name="supportingAudits" value="false" />
<property name="verifyingRevisions" value="false" />
<property name="currentLRUCapacity" value="10000" />
<property name="revisedLRUCapacity" value="100" />

<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.connection.pool_size" value="10" />

<property name="hibernate.dialect"
value="org.hibernate.dialect.DerbyDialect" />
<property name="hibernate.connection.driver_class"
value="org.apache.derby.jdbc.EmbeddedDriver" />
<property name="hibernate.connection.url"
value="jdbc:derby:ProtoDB;create=true" />

<property name="hibernate.connection.autocommit" value="true" />
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider" />

<property name="teneo.mapping.inheritance" value="TABLE_PER_CLASS" />
<property name="teneo.naming.id_feature_as_primary_key" value="id" />

<store type="hibernate">
<mappingProvider type="teneo" />
</store>

</repository>
</cdoServer>


And the stacktrace:
--------------------
2008-09-19 10:03:56 DEBUG org.hibernate.util.JDBCExceptionReporter could
not insert: [org.eclipse.emf.cdo.internal.common.model.CDOPackageImpl]
[insert into cdo_packages (uri, ecore, dynamic, parentUri, metaIDStart,
metaIDSize, CDOPackageImpl) values (?, ?, ?, ?, ?, ?, ?)]
java.sql.SQLException: An unexpected exception was thrown
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLExcep tion(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQL Exception(Unknown
Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleExc eption(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(U nknown
Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(U nknown
Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(U nknown
Source)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeSta tement(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpd ate(Unknown
Source)
at
org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2278)
at
org.hibernate.persister.entity.AbstractEntityPersister.inser t(AbstractEntityPersister.java:2688)
at
org.hibernate.action.EntityInsertAction.execute(EntityInsert Action.java:79)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:27 9)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue. java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue. java:167)
at
org.hibernate.event.def.AbstractFlushingEventListener.perfor mExecutions(AbstractFlushingEventListener.java:321)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(De faultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java :365)
at
org.hibernate.transaction.JDBCTransaction.commit(JDBCTransac tion.java:137)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePacka geHandler.writePackages(HibernatePackageHandler.java:145)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Writer.writePackages(HibernateStoreWriter.java:197)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore Writer.write(HibernateStoreWriter.java:60)
at
org.eclipse.emf.cdo.internal.server.TransactionCommitContext Impl.write(TransactionCommitContextImpl.java:227)
at
org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicatingCommit(CommitTransactionIndication.ja va:167)
at
org.eclipse.emf.cdo.internal.server.protocol.CommitTransacti onIndication.indicating(CommitTransactionIndication.java:68)
at
org.eclipse.emf.cdo.internal.server.protocol.CDOServerIndica tion.indicating(CDOServerIndication.java:116)
at org.eclipse.net4j.signal.Indication.execute(Indication.java: 48)
at
org.eclipse.net4j.signal.IndicationWithResponse.execute(Indi cationWithResponse.java:38)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:186)
at org.eclipse.net4j.signal.Signal.run(Signal.java:167)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unkno wn Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: An unexpected exception was thrown
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLExcepti on(Unknown
Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsFor TransportAcrossDRDA(Unknown
Source)
... 35 more
Caused by: java.sql.SQLException: Java exception: 'A truncation error was
encountered trying to shrink CLOB 'XXXX' to length 255.:
org.apache.derby.iapi.services.io.DerbyIOException'.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLExcepti on(Unknown
Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsFor TransportAcrossDRDA(Unknown
Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLExcep tion(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQL Exception(Unknown
Source)
... 32 more
Caused by: org.apache.derby.iapi.services.io.DerbyIOException: A
truncation error was encountered trying to shrink CLOB 'XXXX' to length
255.
at org.apache.derby.iapi.types.ReaderToUTF8Stream.truncate(Unkn own Source)
at
org.apache.derby.iapi.types.ReaderToUTF8Stream.checkSufficie ntData(Unknown
Source)
at org.apache.derby.iapi.types.ReaderToUTF8Stream.fillBuffer(Un known
Source)
at org.apache.derby.iapi.types.ReaderToUTF8Stream.read(Unknown Source)
at org.apache.derby.impl.store.raw.data.MemByteHolder.write(Unk nown
Source)
at
org.apache.derby.impl.store.raw.data.RememberBytesInputStrea m.fillBuf(Unknown
Source)
at org.apache.derby.impl.store.raw.data.StoredPage.logColumn(Un known
Source)
at org.apache.derby.impl.store.raw.data.StoredPage.logRow(Unkno wn Source)
at
org.apache.derby.impl.store.raw.data.InsertOperation.writeOp tionalDataToBuffer(Unknown
Source)
at org.apache.derby.impl.store.raw.data.InsertOperation.<init>(Unknown
Source)
at
org.apache.derby.impl.store.raw.data.LoggableActions.actionI nsert(Unknown
Source)
at org.apache.derby.impl.store.raw.data.BasePage.insertNoOverfl ow(Unknown
Source)
at org.apache.derby.impl.store.raw.data.BasePage.insertAtSlot(U nknown
Source)
at org.apache.derby.impl.store.raw.data.StoredPage.insertAtSlot (Unknown
Source)
at org.apache.derby.impl.store.raw.data.BasePage.insert(Unknown Source)
at
org.apache.derby.impl.store.access.heap.HeapController.doIns ert(Unknown
Source)
at
org.apache.derby.impl.store.access.heap.HeapController.inser tAndFetchLocation(Unknown
Source)
at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(U nknown
Source)
at
org.apache.derby.impl.sql.execute.InsertResultSet.normalInse rtCore(Unknown
Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unkno wn Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(U nknown
Source)
... 28 more


Any clue what could be wrong?

Regards
Roger
Previous Topic:Advice for Modeling Technologies at Eclipse STP
Next Topic:Problem with CDO/Teneo/Hibernate on Derby
Goto Forum:
  


Current Time: Thu Apr 24 06:35:54 EDT 2014

Powered by FUDForum. Page generated in 0.01797 seconds