Commits

jhouse  committed f71a456

QUARTZ-560, QUARTZ-556, QUARTZ-513 : error depersisting empty job datamaps with various delegates.

git-svn-id: http://svn.opensymphony.com/svn/quartz/trunk@73769f7d36a-ea1c-0410-88ea-9fd03e4c9665

  • Participants
  • Parent commits cd81c56

Comments (0)

Files changed (5)

File src/java/org/quartz/impl/jdbcjobstore/CloudscapeDelegate.java

  * 
  * @author James House
  * @author Sridhar Jawaharlal, Srinivas Venkatarangaiah
+ * @deprecated Use the StdJDBCDelegate for latest versions of Derby
  */
 public class CloudscapeDelegate extends StdJDBCDelegate {
     /**
 
         byte[] inputBytes = rs.getBytes(colName);
 
-        if (null != inputBytes) {
+        if (null != inputBytes && inputBytes.length != 0) {
             ByteArrayInputStream bais = new
             ByteArrayInputStream(inputBytes); 
 

File src/java/org/quartz/impl/jdbcjobstore/HSQLDBDelegate.java

         throws ClassNotFoundException, IOException, SQLException {
         InputStream binaryInput = rs.getBinaryStream(colName);
 
-        if(binaryInput == null) {
+        if(binaryInput == null || binaryInput.available() == 0) {
             return null;
         }
         

File src/java/org/quartz/impl/jdbcjobstore/MSSQLDelegate.java

         throws ClassNotFoundException, IOException, SQLException {
         InputStream binaryInput = rs.getBinaryStream(colName);
 
-        if(binaryInput == null) {
+        if(binaryInput == null || binaryInput.available() == 0) {
             return null;
         }
 

File src/java/org/quartz/impl/jdbcjobstore/PointbaseDelegate.java

 
         InputStream binaryInput = new ByteArrayInputStream(binaryData);
 
-        if (null != binaryInput) {
+        if (null != binaryInput && binaryInput.available() != 0) {
             ObjectInputStream in = new ObjectInputStream(binaryInput);
             try {
                 obj = in.readObject();

File src/java/org/quartz/impl/jdbcjobstore/StdJDBCDelegate.java

         Object obj = null;
 
         Blob blobLocator = rs.getBlob(colName);
-        if (blobLocator != null) {
+        if (blobLocator != null && blobLocator.length() != 0) {
             InputStream binaryInput = blobLocator.getBinaryStream();
 
             if (null != binaryInput) {