Package com.arjuna.ats.arjuna.exceptions

Examples of com.arjuna.ats.arjuna.exceptions.ObjectStoreException


/*     */     throws ObjectStoreException
/*     */   {
/* 126 */     boolean result = false;
/* 127 */     int imageSize = state.length();
/* 128 */     if (imageSize > 10485760)
/* 129 */       throw new ObjectStoreException("Object state is too large - maximum size allowed: 10485760");
/* 130 */     byte[] b = state.buffer();
/* 131 */     if ((imageSize > 0) && (storeValid()))
/*     */     {
/* 133 */       int pool = getPool();
/*     */       try
View Full Code Here


/*     */             }
/*     */             catch (Throwable e)
/*     */             {
/* 124 */               if (count == 9)
/*     */               {
/* 126 */                 throw new ObjectStoreException(e.toString());
/*     */               }
/*     */               try
/*     */               {
/* 130 */                 reconnect(pool);
/*     */               }
/*     */               catch (Throwable th)
/*     */               {
/* 134 */                 throw new ObjectStoreException(e.toString());
/*     */               }
/*     */             }
/*     */           }
/*     */         }
/*     */         finally
/*     */         {
/*     */           try
/*     */           {
/* 143 */             if (rs != null)
/* 144 */               rs.close();
/*     */           }
/*     */           catch (Exception re) {
/*     */           }
/* 148 */           freePool(pool);
/*     */         }
/*     */       }
/* 151 */       return newImage;
/*     */     }
/*     */
/* 154 */     throw new ObjectStoreException("oracle.read_state - object with uid " + objUid + " has no TypeName");
/*     */   }
View Full Code Here

/*     */     throws ObjectStoreException
/*     */   {
/* 160 */     int imageSize = state.length();
/*     */
/* 162 */     if (imageSize > 10485760) {
/* 163 */       throw new ObjectStoreException("Object state is too large - maximum size allowed: 10485760");
/*     */     }
/* 165 */     byte[] b = state.buffer();
/*     */
/* 167 */     if ((imageSize > 0) && (storeValid()))
/*     */     {
/* 169 */       int pool = getPool();
/* 170 */       ResultSet rs = null;
/* 171 */       ResultSet rs3 = null;
/*     */       try
/*     */       {
/* 175 */         for (int count = 0; count < 10; count++)
/*     */         {
/*     */           try
/*     */           {
/* 179 */             PreparedStatement pstmt = this._preparedStatements[pool][9];
/*     */
/* 181 */             this._theConnection[pool].setAutoCommit(false);
/*     */
/* 183 */             if (pstmt == null)
/*     */             {
/* 185 */               pstmt = this._theConnection[pool].prepareStatement("SELECT ObjectState FROM " + tableName + " WHERE UidString = ? AND StateType = ? AND TypeName = ? FOR UPDATE", 1003, 1008);
/* 186 */               this._preparedStatements[pool][9] = pstmt;
/*     */             }
/* 188 */             pstmt.setString(1, objUid.stringForm());
/* 189 */             pstmt.setInt(2, s);
/* 190 */             pstmt.setString(3, tName);
/*     */
/* 192 */             rs = pstmt.executeQuery();
/*     */
/* 194 */             if (rs.next())
/*     */             {
/* 196 */               BLOB myBlob = (BLOB)rs.getBlob(1);
/* 197 */               myBlob.putBytes(1L, b);
/*     */             }
/*     */             else
/*     */             {
/* 201 */               pstmt2 = this._preparedStatements[pool][6];
/*     */
/* 203 */               if (pstmt2 == null)
/*     */               {
/* 205 */                 pstmt2 = this._theConnection[pool].prepareStatement("INSERT INTO " + tableName + " (StateType,TypeName,UidString,ObjectState) VALUES (?,?,?,empty_blob())");
/*     */
/* 207 */                 this._preparedStatements[pool][6] = pstmt2;
/*     */               }
/*     */
/* 210 */               pstmt2.setInt(1, s);
/* 211 */               pstmt2.setString(2, tName);
/* 212 */               pstmt2.setString(3, objUid.stringForm());
/*     */
/* 214 */               pstmt2.executeUpdate();
/* 215 */               this._theConnection[pool].commit();
/*     */
/* 217 */               PreparedStatement pstmt3 = this._preparedStatements[pool][8];
/* 218 */               if (pstmt3 == null) {
/* 219 */                 pstmt3 = this._theConnection[pool].prepareStatement("SELECT ObjectState FROM " + tableName + " WHERE UidString = ? AND TypeName = ? AND StateType = ? FOR UPDATE");
/* 220 */                 this._preparedStatements[pool][8] = pstmt3;
/*     */               }
/*     */
/* 223 */               pstmt3.setString(1, objUid.stringForm());
/* 224 */               pstmt3.setString(2, tName);
/* 225 */               pstmt3.setInt(3, s);
/*     */
/* 227 */               rs3 = pstmt3.executeQuery();
/* 228 */               rs3.next();
/* 229 */               BLOB myBlob = (BLOB)rs3.getBlob(1);
/* 230 */               myBlob.putBytes(1L, b);
/*     */             }
/*     */
/* 233 */             this._theConnection[pool].commit();
/* 234 */             pstmt2 = 1;
/*     */             try
/*     */             {
/* 261 */               this._theConnection[pool].setAutoCommit(true);
/*     */             }
/*     */             catch (Exception e) {
/*     */             }
/*     */             try {
/* 266 */               if (rs != null)
/* 267 */                 rs.close();
/*     */             }
/*     */             catch (Exception re)
/*     */             {
/*     */             }
/*     */             try
/*     */             {
/* 274 */               if (rs3 != null)
/* 275 */                 rs3.close();
/*     */             }
/*     */             catch (Exception re3)
/*     */             {
/*     */             }
/* 280 */             freePool(pool); return pstmt2;
/*     */           }
/*     */           catch (Throwable e)
/*     */           {
/*     */             PreparedStatement pstmt2;
/* 239 */             if (count == 9)
/*     */             {
/* 241 */               if (tsLogger.arjLoggerI18N.isWarnEnabled()) {
/* 242 */                 tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.jdbc.oracle_2", new Object[] { e });
/*     */               }
/* 244 */               pstmt2 = 0;
/*     */               try
/*     */               {
/* 261 */                 this._theConnection[pool].setAutoCommit(true);
/*     */               }
/*     */               catch (Exception e) {
/*     */               }
/*     */               try {
/* 266 */                 if (rs != null)
/* 267 */                   rs.close();
/*     */               }
/*     */               catch (Exception re)
/*     */               {
/*     */               }
/*     */               try
/*     */               {
/* 274 */                 if (rs3 != null)
/* 275 */                   rs3.close();
/*     */               }
/*     */               catch (Exception re3)
/*     */               {
/*     */               }
/* 280 */               freePool(pool); return pstmt2;
/*     */             }
/*     */             try
/*     */             {
/* 248 */               reconnect(pool);
/*     */             }
/*     */             catch (Throwable th)
/*     */             {
/* 252 */               throw new ObjectStoreException(e.toString());
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */       finally
View Full Code Here

/* 115 */             tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.drivers.oracle_8_0_1");
/*     */           }
/*     */         }
/*     */         catch (Exception e)
/*     */         {
/* 120 */           throw new ObjectStoreException(e.toString());
/*     */         }
/*     */         finally
/*     */         {
/*     */           try
/*     */           {
/* 126 */             rs.close();
/*     */           }
/*     */           catch (Exception re) {
/*     */           }
/* 130 */           freePool(pool);
/*     */         }
/*     */       }
/*     */     }
/*     */     else {
/* 135 */       throw new ObjectStoreException("oracle_8_0.read_state - object with uid " + objUid + " has no TypeName");
/*     */     }
/* 137 */     return newImage;
/*     */   }
View Full Code Here

/* 143 */     boolean result = false;
/*     */
/* 145 */     int imageSize = state.length();
/*     */
/* 147 */     if (imageSize > 65535) {
/* 148 */       throw new ObjectStoreException("Object state is too large - maximum size allowed: 65535");
/*     */     }
/* 150 */     byte[] b = state.buffer();
/*     */
/* 152 */     if ((imageSize > 0) && (storeValid()))
/*     */     {
View Full Code Here

/*     */           Object buffer;
/* 115 */           if (retryConnection(e, pool)) {
/* 116 */             buffer = read_state(objUid, tName, ft, tableName);
/*     */             return buffer;
/*     */           }
/* 118 */           throw new ObjectStoreException(e.toString());
/*     */         }
/*     */         finally
/*     */         {
/*     */           try
/*     */           {
/* 125 */             rs.close();
/*     */           }
/*     */           catch (Exception re) {
/*     */           }
/* 129 */           freePool(pool);
/*     */         }
/*     */       }
/*     */     }
/*     */     else {
/* 134 */       throw new ObjectStoreException("sqlserver.read_state - object with uid " + objUid + " has no TypeName");
/*     */     }
/* 136 */     return (InputObjectState)newImage;
/*     */   }
View Full Code Here

/* 142 */     boolean result = false;
/*     */
/* 144 */     int imageSize = state.length();
/*     */
/* 146 */     if (imageSize > 65535) {
/* 147 */       throw new ObjectStoreException("Object state is too large - maximum size allowed: 65535");
/*     */     }
/* 149 */     byte[] b = state.buffer();
/*     */
/* 151 */     if ((imageSize > 0) && (storeValid()))
/*     */     {
View Full Code Here

/*     */         catch (NumberFormatException e)
/*     */         {
/*     */         }
/*     */         catch (IOException e)
/*     */         {
/* 308 */           throw new ObjectStoreException(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore_2a"));
/*     */         }
/*     */       }
/*     */     }
/*     */
/*     */     try
/*     */     {
/* 315 */       Uid.nullUid().pack(store);
/*     */     }
/*     */     catch (IOException e)
/*     */     {
/* 319 */       throw new ObjectStoreException(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore_3"));
/*     */     }
/*     */
/* 322 */     state.setBuffer(store.buffer());
/*     */
/* 324 */     store = null;
View Full Code Here

/*     */
/* 359 */           result = allTypes(store, entry[i]);
/*     */         }
/*     */         catch (IOException e)
/*     */         {
/* 363 */           throw new ObjectStoreException(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore_4"));
/*     */         }
/*     */       }
/*     */
/* 367 */       tmpFile = null;
/*     */     }
/*     */
/*     */     try
/*     */     {
/* 373 */       store.packString("");
/*     */     }
/*     */     catch (IOException e)
/*     */     {
/* 377 */       throw new ObjectStoreException(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore_5"));
/*     */     }
/*     */
/* 380 */     foundTypes.setBuffer(store.buffer());
/*     */
/* 382 */     return result;
View Full Code Here

/*     */
/* 515 */           tmpFile = null;
/*     */         }
/*     */         catch (IOException e)
/*     */         {
/* 519 */           throw new ObjectStoreException(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.objectstore.FileSystemStore_7"));
/*     */         }
/*     */       }
/*     */
/*     */     }
/*     */
View Full Code Here

TOP

Related Classes of com.arjuna.ats.arjuna.exceptions.ObjectStoreException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.