sranka / jdbcimage

Fast database schema export and import
MIT License
16 stars 14 forks source link

IllegalStateException: Unable to serialize SQL type: -155, Object: 2021-07-15 01:00:00 +00:00 #9

Closed arcadius closed 3 years ago

arcadius commented 3 years ago

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Unable to serialize SQL type: -155, Object: 2021-07-15 01:00:00 +00:00 at pz.tool.jdbcimage.main.MainToolBase.runConcurrently(MainToolBase.java:511) at pz.tool.jdbcimage.main.MainToolBase.run(MainToolBase.java:443) at pz.tool.jdbcimage.main.MultiTableParallelExport.run(MultiTableParallelExport.java:24) at pz.tool.jdbcimage.main.MultiTableParallelExport.main(MultiTableParallelExport.java:52) at pz.tool.jdbcimage.main.JdbcImageMain.main(JdbcImageMain.java:18) Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Unable to serialize SQL type: -155, Object: 2021-07-15 01:00:00 +00:00 at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006) at pz.tool.jdbcimage.main.MainToolBase.runConcurrently(MainToolBase.java:509) ... 4 more Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Unable to serialize SQL type: -155, Object: 2021-07-15 01:00:00 +00:00 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:600) ... 6 more Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Unable to serialize SQL type: -155, Object: 2021-07-15 01:00:00 +00:00 at pz.tool.jdbcimage.db.QueryRunner.run(QueryRunner.java:50) at pz.tool.jdbcimage.main.SingleTableExport.exportTable(SingleTableExport.java:41) at pz.tool.jdbcimage.main.MultiTableParallelExport.lambda$getExportTask$1(MultiTableParallelExport.java:33) at pz.tool.jdbcimage.main.MainToolBase.lambda$runConcurrently$7(MainToolBase.java:485) at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1448) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) Caused by: java.lang.IllegalStateException: Unable to serialize SQL type: -155, Object: 2021-07-15 01:00:00 +00:00 at pz.tool.jdbcimage.kryo.KryoResultSetConsumer.accept(KryoResultSetConsumer.java:132) at pz.tool.jdbcimage.kryo.KryoResultSetConsumer.accept(KryoResultSetConsumer.java:19) at pz.tool.jdbcimage.db.QueryRunner.run(QueryRunner.java:44) ... 9 more

sranka commented 3 years ago

SQL Type -155 is not supported. Can you be more specific about JDBC driver / connection that was used?

arcadius commented 3 years ago

./jdbcimage export mssqlserver.zip -url=jdbc:sqlserver://MYHOST:1433;databaseName=MYDB -user=MYUSER -password=SECRET I was using the provided SQL server driver

sranka commented 3 years ago

An exported table contains sql_variant column, which is not supported by the tool. pz.tool.jdbcimage.kryo.KryoResultSetConsumer could be possibly extended to support this type, is this something you are willing to help with?

sranka commented 3 years ago

Actually, it is a DATETIMEOFFSET (microsoft.sql.DateTimeOffset) that is not supported. sql_variant type number is -156

sranka commented 3 years ago

@arcadius MSSQL datetimeoffset type is now supported, you can give it a try with v0.8.3 release.