使用clob数据类型

时间:2017-09-06 23:45:21

标签: ignite

非常感谢你的帮助〜

我有一个CLOB数据类型的DB字段。最初我们在POJO中使用了String,它设法使用以下JdbcTypeField将数据存储到DB中

new JdbcTypeField(Types.CLOB, "VALUE_X", String.class, "valueX")

但是,插入更大的数据时会遇到问题。 ORA-01461: can bind a LONG value only for insert into a LONG column-Occurs when querying

现在我们尝试使用以下设置将变量更改为Clob:

new JdbcTypeField(Types.CLOB, "VALUE_X", Clob.class, "valueX"),

但是,我们遇到了以下错误,对此错误有任何想法吗?

Caused by: org.apache.ignite.binary.BinaryObjectException: Failed to marshal 
object with optimized marshaller: oracle.jdbc.driver.T4CConnection@1c70676
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:186) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:147) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:134) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteObject(BinaryWriterExImpl.java:496) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.writeObjectField(BinaryWriterExImpl.java:1160) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.write(BinaryFieldAccessor.java:663) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryClassDescriptor.write(BinaryClassDescriptor.java:793) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:206) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:147) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:134) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteObject(BinaryWriterExImpl.java:496) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.writeObjectField(BinaryWriterExImpl.java:1160) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.write(BinaryFieldAccessor.java:663) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryClassDescriptor.write(BinaryClassDescriptor.java:793) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:206) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:147) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:134) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteObject(BinaryWriterExImpl.java:496) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.writeObjectField(BinaryWriterExImpl.java:1160) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.write(BinaryFieldAccessor.java:663) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryClassDescriptor.write(BinaryClassDescriptor.java:793) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:206) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:147) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:134) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteObject(BinaryWriterExImpl.java:496) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.writeObjectField(BinaryWriterExImpl.java:1160) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryFieldAccessor$DefaultFinalClassAccessor.write(BinaryFieldAccessor.java:663) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryClassDescriptor.write(BinaryClassDescriptor.java:793) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:206) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:147) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal(BinaryWriterExImpl.java:134) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.doWriteObject(BinaryWriterExImpl.java:496) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.builder.BinaryBuilderSerializer.writeValue(BinaryBuilderSerializer.java:207) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.builder.BinaryValueWithType.writeTo(BinaryValueWithType.java:48) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.builder.BinaryBuilderSerializer.writeValue(BinaryBuilderSerializer.java:73) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.builder.BinaryBuilderSerializer.writeValue(BinaryBuilderSerializer.java:54) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.serializeTo(BinaryObjectBuilderImpl.java:313) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.build(BinaryObjectBuilderImpl.java:183) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore.buildBinaryObject(CacheJdbcPojoStore.java:252) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStore.buildObject(CacheJdbcPojoStore.java:136) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$1.call(CacheAbstractJdbcStore.java:467) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.cache.store.jdbc.CacheAbstractJdbcStore$1.call(CacheAbstractJdbcStore.java:434) ~[ignite-core-2.1.0.jar:2.1.0]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[na:1.8.0_101]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[na:1.8.0_101]
    at java.lang.Thread.run(Unknown Source) ~[na:1.8.0_101]
Caused by: org.apache.ignite.IgniteCheckedException: Failed to serialize object: oracle.jdbc.driver.T4CConnection@1c70676
    at org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller.marshal0(OptimizedMarshaller.java:206) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.marshal(AbstractNodeNameAwareMarshaller.java:58) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.util.IgniteUtils.marshal(IgniteUtils.java:9815) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.binary.BinaryWriterExImpl.marshal0(BinaryWriterExImpl.java:179) ~[ignite-core-2.1.0.jar:2.1.0]
    ... 45 common frames omitted
Caused by: java.io.IOException: java.lang.NullPointerException
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeSerializable(OptimizedObjectOutputStream.java:324) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedClassDescriptor.write(OptimizedClassDescriptor.java:827) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeObject0(OptimizedObjectOutputStream.java:224) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeFields(OptimizedObjectOutputStream.java:516) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeSerializable(OptimizedObjectOutputStream.java:328) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedClassDescriptor.write(OptimizedClassDescriptor.java:827) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeObject0(OptimizedObjectOutputStream.java:224) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeFields(OptimizedObjectOutputStream.java:516) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeSerializable(OptimizedObjectOutputStream.java:328) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedClassDescriptor.write(OptimizedClassDescriptor.java:827) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeObject0(OptimizedObjectOutputStream.java:224) ~[ignite-core-2.1.0.jar:2.1.0]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeObjectOverride(OptimizedObjectOutputStream.java:152) ~[ignite-core-2.1.0.jar:2.1.0]
    at java.io.ObjectOutputStream.writeObject(Unknown Source) ~[na:1.8.0_101]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedMarshaller.marshal0(OptimizedMarshaller.java:201) ~[ignite-core-2.1.0.jar:2.1.0]
    ... 48 common frames omitted
Caused by: java.lang.NullPointerException: null
    at oracle.jdbc.internal.OpaqueString.writeObject(OpaqueString.java:93) ~[ojdbc8-12.2.0.1.jar:12.2.0.1.0]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101]
    at org.apache.ignite.internal.marshaller.optimized.OptimizedObjectOutputStream.writeSerializable(OptimizedObjectOutputStream.java:318) ~[ignite-core-2.1.0.jar:2.1.0]
    ... 61 common frames omitted

0 个答案:

没有答案