Home » Modeling » EMF » [CDO] How to customize the length of a TABLE column in DBStore (H2) to avoid JdbcSQLException(What is the best way to enhance the size of a column or change its type from VARCHAR to CLOB)
[CDO] How to customize the length of a TABLE column in DBStore (H2) to avoid JdbcSQLException [message #931517] |
Wed, 03 October 2012 09:28 |
Jerome Godard Messages: 6 Registered: November 2010 |
Junior Member |
|
|
When exporting my model to my CDO server (Legacy mode, using the DBStore H2) I get the following exception:
[ERROR] org.h2.jdbc.JdbcSQLException: Value too long for column DESCRIPTION VARCHAR(32672): STRINGDECODE('<hr><b>*** Test Manager</b><br>MY COMMENT<hr><b>*** Test description</b><br><P> </P><P align=center><B... (45550); SQL statement:
INSERT INTO ctx_Mission(cdo_id, cdo_version, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, id, sid, name, changeable, reserver,
generated, version, visibleInDoc, visibleInLM, summary, description, status, ownedSystemMissionInvolvement, ownedExtensions, ownedConstraints, ownedEx
tensionPoints, ownedPropertyValues, ownedEnumerationPropertyTypes, appliedPropertyValues, ownedPropertyValueGroups, appliedPropertyValueGroups, featur
es, ownedActorMissionInvolvements, ownedCapabilityExploitations) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?) [90005-117]
org.eclipse.net4j.db.DBException: org.h2.jdbc.JdbcSQLException: Value too long for column DESCRIPTION VARCHAR(32672): STRINGDECODE('<hr><b>*** Test Manager</b><br>MY COMMENT<hr><b>*** Test description</b><br><P> </P><P align=center><B... (45550); SQL statement:
INSERT INTO ctx_Mission(cdo_id, cdo_version, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, id, sid, name, changeable, reserver,
generated, version, visibleInDoc, visibleInLM, summary, description, status, ownedSystemMissionInvolvement, ownedExtensions, ownedConstraints, ownedEx
tensionPoints, ownedPropertyValues, ownedEnumerationPropertyTypes, appliedPropertyValues, ownedPropertyValueGroups, appliedPropertyValueGroups, featur
es, ownedActorMissionInvolvements, ownedCapabilityExploitations) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?) [90005-117]
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping.writeValues(HorizontalNonAuditClassMapping.java:31
0)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.writeRevision(AbstractHorizontalClassMapping.java:
511)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevision(DBStoreAccessor.java:579)
at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevisions(DBStoreAccessor.java:559)
at org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:89)
at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
at org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.h2.jdbc.JdbcSQLException: Value too long for column DESCRIPTION VARCHAR(32672): STRINGDECODE('<hr><b>*** Function Manager</b><br>Elodie
GEORGES<hr><b>*** Function description</b><br><P> </P><P align=center><B... (45550); SQL statement:
INSERT INTO ctx_Mission(cdo_id, cdo_version, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, id, sid, name, changeable, reserver,
generated, version, visibleInDoc, visibleInLM, summary, description, status, ownedSystemMissionInvolvement, ownedExtensions, ownedConstraints, ownedEx
tensionPoints, ownedPropertyValues, ownedEnumerationPropertyTypes, appliedPropertyValues, ownedPropertyValueGroups, appliedPropertyValueGroups, featur
es, ownedActorMissionInvolvements, ownedCapabilityExploitations) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?, ?, ?) [90005-117]
at org.h2.message.Message.getSQLException(Message.java:105)
at org.h2.message.Message.getSQLException(Message.java:116)
at org.h2.table.Column.validateConvertUpdateSequence(Column.java:301)
at org.h2.table.Table.validateConvertUpdateSequence(Table.java:593)
at org.h2.command.dml.Insert.update(Insert.java:98)
at org.h2.command.CommandContainer.update(CommandContainer.java:72)
at org.h2.command.Command.executeUpdate(Command.java:208)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:140)
at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129)
at org.eclipse.net4j.db.DBUtil.update(DBUtil.java:561)
at org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping.writeValues(HorizontalNonAuditClassMapping.java:30
I would like to know if there is a way to easily increase the size of this column without modifying my initial model : how to increase the default maximum size for a column in cdo-config.xml? how to customize the mapping to automatically swich to a CLOB if the field is bigger than a specified value? etc...
I did not find the information from the CDO Server configuration.
Thanks for your help
Jérôme
|
|
|
Re: [CDO] How to customize the length of a TABLE column in DBStore (H2) to avoid JdbcSQLException [message #931669 is a reply to message #931517] |
Wed, 03 October 2012 12:07 |
|
Hi Jerome,
You can extend/customize H2Adapter or use the model annotations recognized by
http://git.eclipse.org/c/cdo/cdo.git/tree/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBAnnotation.java
..
The column type/length must be known at the time the model is mapped. There's no way to change them after that point in
time.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Am 03.10.2012 11:28, schrieb Jerome Godard:
> When exporting my model to my CDO server (Legacy mode, using the DBStore H2) I get the following exception:
>
> [ERROR] org.h2.jdbc.JdbcSQLException: Value too long for column DESCRIPTION VARCHAR(32672): STRINGDECODE('<hr><b>***
> Test Manager</b><br>MY COMMENT<hr><b>*** Test description</b><br><P> </P><P align=center><B... (45550); SQL statement:
>
> INSERT INTO ctx_Mission(cdo_id, cdo_version, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, id,
> sid, name, changeable, reserver,
>
> generated, version, visibleInDoc, visibleInLM, summary, description, status, ownedSystemMissionInvolvement,
> ownedExtensions, ownedConstraints, ownedEx
>
> tensionPoints, ownedPropertyValues, ownedEnumerationPropertyTypes, appliedPropertyValues, ownedPropertyValueGroups,
> appliedPropertyValueGroups, featur
>
> es, ownedActorMissionInvolvements, ownedCapabilityExploitations) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>
> ?, ?, ?, ?, ?) [90005-117]
>
> org.eclipse.net4j.db.DBException: org.h2.jdbc.JdbcSQLException: Value too long for column DESCRIPTION VARCHAR(32672):
> STRINGDECODE('<hr><b>*** Test Manager</b><br>MY COMMENT<hr><b>*** Test description</b><br><P> </P><P
> align=center><B... (45550); SQL statement:
>
> INSERT INTO ctx_Mission(cdo_id, cdo_version, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, id,
> sid, name, changeable, reserver,
>
> generated, version, visibleInDoc, visibleInLM, summary, description, status, ownedSystemMissionInvolvement,
> ownedExtensions, ownedConstraints, ownedEx
>
> tensionPoints, ownedPropertyValues, ownedEnumerationPropertyTypes, appliedPropertyValues, ownedPropertyValueGroups,
> appliedPropertyValueGroups, featur
>
> es, ownedActorMissionInvolvements, ownedCapabilityExploitations) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>
> ?, ?, ?, ?, ?) [90005-117]
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping.writeValues(HorizontalNonAuditClassMapping.java:31
>
> 0)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.AbstractHorizontalClassMapping.writeRevision(AbstractHorizontalClassMapping.java:
>
> 511)
>
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevision(DBStoreAccessor.java:579)
>
> at org.eclipse.emf.cdo.server.internal.db.DBStoreAccessor.writeRevisions(DBStoreAccessor.java:559)
>
> at org.eclipse.emf.cdo.spi.server.StoreAccessor.doWrite(StoreAccessor.java:89)
>
> at org.eclipse.emf.cdo.spi.server.StoreAccessorBase.write(StoreAccessorBase.java:150)
>
> at org.eclipse.emf.cdo.internal.server.TransactionCommitContext.write(TransactionCommitContext.java:463)
>
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:42)
>
> at org.eclipse.emf.cdo.spi.server.InternalCommitContext$1.runLoop(InternalCommitContext.java:1)
>
> at org.eclipse.net4j.util.om.monitor.ProgressDistributor.run(ProgressDistributor.java:96)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicatingCommit(CommitTransactionIndication.java:244)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CommitTransactionIndication.indicating(CommitTransactionIndication.java:92)
>
> at
> org.eclipse.emf.cdo.server.internal.net4j.protocol.CDOServerIndicationWithMonitoring.indicating(CDOServerIndicationWithMonitoring.java:109)
>
>
>
> at org.eclipse.net4j.signal.IndicationWithMonitoring.indicating(IndicationWithMonitoring.java:84)
>
> at org.eclipse.net4j.signal.IndicationWithResponse.doExtendedInput(IndicationWithResponse.java:90)
>
> at org.eclipse.net4j.signal.Signal.doInput(Signal.java:326)
>
> at org.eclipse.net4j.signal.IndicationWithResponse.execute(IndicationWithResponse.java:63)
>
> at org.eclipse.net4j.signal.IndicationWithMonitoring.execute(IndicationWithMonitoring.java:63)
>
> at org.eclipse.net4j.signal.Signal.runSync(Signal.java:251)
>
> at org.eclipse.net4j.signal.Signal.run(Signal.java:147)
>
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
>
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>
> at java.lang.Thread.run(Unknown Source)
>
> Caused by: org.h2.jdbc.JdbcSQLException: Value too long for column DESCRIPTION VARCHAR(32672):
> STRINGDECODE('<hr><b>*** Function Manager</b><br>Elodie
>
> GEORGES<hr><b>*** Function description</b><br><P> </P><P align=center><B... (45550); SQL statement:
>
> INSERT INTO ctx_Mission(cdo_id, cdo_version, cdo_created, cdo_revised, cdo_resource, cdo_container, cdo_feature, id,
> sid, name, changeable, reserver,
>
> generated, version, visibleInDoc, visibleInLM, summary, description, status, ownedSystemMissionInvolvement,
> ownedExtensions, ownedConstraints, ownedEx
>
> tensionPoints, ownedPropertyValues, ownedEnumerationPropertyTypes, appliedPropertyValues, ownedPropertyValueGroups,
> appliedPropertyValueGroups, featur
>
> es, ownedActorMissionInvolvements, ownedCapabilityExploitations) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
> ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
>
> ?, ?, ?, ?, ?) [90005-117]
>
> at org.h2.message.Message.getSQLException(Message.java:105)
>
> at org.h2.message.Message.getSQLException(Message.java:116)
>
> at org.h2.table.Column.validateConvertUpdateSequence(Column.java:301)
>
> at org.h2.table.Table.validateConvertUpdateSequence(Table.java:593)
>
> at org.h2.command.dml.Insert.update(Insert.java:98)
>
> at org.h2.command.CommandContainer.update(CommandContainer.java:72)
>
> at org.h2.command.Command.executeUpdate(Command.java:208)
>
> at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:140)
>
> at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:129)
>
> at org.eclipse.net4j.db.DBUtil.update(DBUtil.java:561)
>
> at
> org.eclipse.emf.cdo.server.internal.db.mapping.horizontal.HorizontalNonAuditClassMapping.writeValues(HorizontalNonAuditClassMapping.java:30
>
> I would like to know if there is a way to easily increase the size of this column without modifying my initial model :
> how to increase the default maximum size for a column in cdo-config.xml? how to customize the mapping to automatically
> swich to a CLOB if the field is bigger than a specified value? etc...
>
> I did not find the information from the CDO Server configuration.
>
> Thanks for your help
>
> Jérôme
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Goto Forum:
Current Time: Wed Sep 25 19:36:30 GMT 2024
Powered by FUDForum. Page generated in 0.03551 seconds
|