History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QUARTZ-566
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: James House
Reporter: Gilles Dubuc
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

MSSQLDelegate.getObjectFromBlob throws org.quartz.JobPersistenceException: Couldn't obtain triggers for job: null [See nested exception: java.io.EOFException]

Created: 07/Mar/07 06:14 AM   Updated: 21/Oct/07 02:10 PM
Component/s: Job Stores
Affects Version/s: 1.6
Fix Version/s: 1.6.1

File Attachments: 1. Java Source File MyMSSQLDelegate.java (7 kb)

Environment: Quartz running on JBoss 4.0.4 connected to a MSSQL 2000 service pasck 3 server as datasource
Issue Links:
Related
 
This issue is related to:
QUARTZ-513 EOFException being throw in StdJDBCDe... Critical Closed
QUARTZ-560 Trigger with empty JobDataMap can't b... Major Closed


 Description  « Hide
Similar issue as QUARTZ-513. The problem encountered is described in this thread: http://forums.opensymphony.com/thread.jspa?forumID=6&threadID=59406

 All   Comments   Change History      Sort Order:
Gilles Dubuc - [07/Mar/07 06:26 AM ]
This is my fix for the issue.
Jasper Rosenberg had suggested most of the changes on the forums, but the pieces didn't fit together (insertTrigger was creating a byte array while getJobDetailFromBlob was reading a binary stream). After looking at the original StdJDBCDelegate and MSSQLDelegate, it seems that this "binary stream on one side and byte array on the other" is present. That might be the cause of the problem in the related bugs. My fix simply makes getJobDetailFromBlob read a byte array instead of a binary stream from the column (in addition to Jasper's extra nullity checks).

I hope it helps.

Henri Yandell - [03/May/07 02:00 PM ]
Looking at the forums, it seems that the MSSQLDelegate is unnecessary and MSSQL users can go back to using StdJdbcDelegate?

leonid dolbir - [03/May/07 05:34 PM ]
the problem is in StdJdbcDelegate itself. Prepared statement receives byte[] argument when there is no data to be saved. StdJdbcDelegate is only checking blob for null but not for empty Blob object. I solved it by subclassing StdJdbcDelegate and overriding protected Object getObjectFromBlob(ResultSet rs, String colName) throws ClassNotFoundException, IOException, SQLException{
    Blob blobLocator = rs.getBlob(colName);
    if (blobLocator == null || blobLocator.length() == 0){
      return null;
    }
    return super.getObjectFromBlob(rs, colName);
  }

James House - [21/Oct/07 02:10 PM ]
added check for empty (but non-null) blob.