Results 1 to 4 of 4

Thread: SERIALIZED_CONTEXT set to empty string on Sybase

  1. #1

    Default SERIALIZED_CONTEXT set to empty string on Sybase

    Hi,

    I'm having a problem where it seems that the SERIALIZED_CONTEXT is set to empty string at some point during the batch execution (it is set to null at insert at the beginning of the execution). I have tried adding break points in the JdbcExecutionContextDao to see where this is happening. However I haven't found anything, the persistSerializedContext() method is always executed with setNull.

    The problem occurs when I restart a failed batch, as the value in SERIALIZED_CONTEXT is not null, it is read and attempted parsed with JSON and fails.

    Have anyone experienced similar problems? I'm using SB 2.0.1, but an upgrade to 2.0.2 didn't help either.

    Changing the code in the ExecutionContextRowMapper to check for null and empty strings would help, however I'm not sure if that is something that you'd like to implement.

    Are there any other places in Spring Batch where BATCH_JOB_EXECUTION_CONTEXT is updated, besides the persistSerializedContext in JdbcExecutionContextDao

  2. #2
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    Quote Originally Posted by magott View Post
    Are there any other places in Spring Batch where BATCH_JOB_EXECUTION_CONTEXT is updated, besides the persistSerializedContext in JdbcExecutionContextDao
    No. But some database drivers helpfully convert nulls into empty strings for no apparent reason. Can you try another driver version? What version of Sybase is it?

  3. #3

    Default

    Quote Originally Posted by Dave Syer View Post
    No. But some database drivers helpfully convert nulls into empty strings for no apparent reason. Can you try another driver version? What version of Sybase is it?
    I was thinking about that, and wrote a small program that did a insert, update and then verified that the text-value was null. So if the driver is to blame, it must be that it only converts nulls to blanks under some circumstances, and not all updates.

    I'll find the version number of the Sybase install and the driver tomorrow. I know we are using a jdts driver and not the connector from sybase.

  4. #4

    Thumbs up Resolved

    You were quite right, it was the jtds driver that caused the problem. Upgraded from 1.2 to 1.2.2 and now it works.

    Thanks for the input.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •