Package nexj.core.persistence

Examples of nexj.core.persistence.OptimisticLockException


            {
               if (updateCounts[i] != 1 && (m_lockingColumn != null || m_bInsert || updateCounts[i] != PreparedStatement.SUCCESS_NO_INFO))
               {
                  if (isPrimary())
                  {
                     throw new OptimisticLockException(workArray[nStart + i].getInstance());
                  }
                  else if (m_bInsert)
                  {
                     if (!bInsert)
                     {
                        stmt = stmt.getConnection().prepareStatement(getInsertSQL());
                        bInsert = true;
                     }

                     ((SQLUpdate)workArray[nStart + i]).bindInsert(stmt, 0);
                     stmt.addBatch();                    
                  }
               }

               if (m_bKeyChanged)
               {
                  ((SQLUpdate)workArray[nStart + i]).updateOID();
               }
            }

            if (bInsert)
            {
               m_adapter.executeBatch(stmt);
            }
         }
         else
         {
            if (m_adapter.executeUpdate(stmt) != 1)
            {
               if (isPrimary())
               {
                  throw new OptimisticLockException(m_instance);
               }
               else if (m_bInsert)
               {
                  stmt = stmt.getConnection().prepareStatement(getInsertSQL());
                  bInsert = true;
View Full Code Here


           
            for (int i = 0; i < nCount; ++i)
            {
               if (updateCounts[i] != 1 && (m_lockingColumn != null || updateCounts[i] != PreparedStatement.SUCCESS_NO_INFO))
               {
                  throw new OptimisticLockException(workArray[nStart + i].getInstance());
               }
            }
         }
      }
      else
      {
         if (m_adapter.executeUpdate(stmt) != 1)
         {
            if (isPrimary())
            {
               throw new OptimisticLockException(m_instance);
            }
         }
      }
   }
View Full Code Here

                                          instance.getOldValueDirect(i) == this)
                                       {
                                          throw new AssociationIntegrityException(instance, attribute.getName());
                                       }

                                       throw new OptimisticLockException(this);
                                    }
                                 }
                              }
                           }
                        }
                     }
                  }
                  else if (!Query.createRead(getLazyMetaclass(), null, new Pair(Symbol.AT).eq(m_oid),
                     null, -1, 0, false, Query.SEC_NONE, m_context).read().isEmpty())
                  {
                     throw new AssociationIntegrityException(this);
                  }

                  throw new OptimisticLockException(this);
               }
            }

            if (bLoad)
            {
View Full Code Here

               {
                  m_bLockMismatch = true;

                  if ((m_nMode & LOCK) != 0)
                  {
                     throw new OptimisticLockException(instance);
                  }

                  if (isCached())
                  {
                     return instance;
                  }

                  if (m_context.isLocked(instance))
                  {
                     throw new OptimisticLockException(instance);
                  }
               }
            }
         }
View Full Code Here

               s_logger.debug("LOCKING " + ( (((Long)lockValue).longValue() < lCurrentLockValue) ? "BAD" : "GOOD") + " instance=" + lockValue + " file=" + lCurrentLockValue);
            }
           
            if (((Long)lockValue).longValue() < lCurrentLockValue)
            {
               throw new OptimisticLockException(m_instance);
            }
         }
        
         Object dataToWrite = null;
        
View Full Code Here

TOP

Related Classes of nexj.core.persistence.OptimisticLockException

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.