Examples of DuplicateKeyException


Examples of com.foundationdb.server.error.DuplicateKeyException

            txn.getIndexChecks(false) == null) {
            check.blockUntilReady(txn);
            if (!check.check(session, txn, index)) {
                // Using RowData, can give better error than check.throwException().
                String msg = formatIndexRowString(session, rowData, index);
                throw new DuplicateKeyException(index.getIndexName(), msg);
            }
        }
        else {
            txn.getIndexChecks(false).add(session, txn, index, check);
        }
View Full Code Here

Examples of com.foundationdb.server.error.DuplicateKeyException

                existed = iEx.traverse(Key.Direction.EQ, true, -1);
            }
            if (existed) {
                LOG.debug("Duplicate key for index {}, raw: {}", index.getIndexName(), key);
                String msg = formatIndexRowString(session, rowData, index);
                throw new DuplicateKeyException(index.getIndexName(), msg);
            }
        }
    }
View Full Code Here

Examples of com.foundationdb.server.error.DuplicateKeyException

        public RuntimeException createException(Session session, TransactionState txn, Index index) {
            // Recover Key for error message.
            Key persistitKey = new Key((Persistit)null);
            FDBStoreDataHelper.unpackTuple(index, persistitKey, bkey);
            String msg = formatIndexRowString(index, persistitKey);
            return new DuplicateKeyException(index.getIndexName(), msg);
        }
View Full Code Here

Examples of com.persistit.exception.DuplicateKeyException

     *             exists
     * @throws Exception
     */
    protected boolean duplicateKeyDetected(final Tree tree, final Key key, final Value v1, final Value v2)
            throws Exception {
        throw new DuplicateKeyException(String.format("Tree=%s Key=%s", tree, key));
    }
View Full Code Here

Examples of com.persistit.exception.DuplicateKeyException

     *             exists
     * @throws Exception
     */
    protected boolean duplicateKeyDetected(final Tree tree, final Key key, final Value v1, final Value v2)
            throws Exception {
        throw new DuplicateKeyException(String.format("Tree=%s Key=%s", tree, key));
    }
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

      try {
         Object id = idField.get(ctx.getInstance());
        
         // Check exist
         if (getFile(id).exists())
            throw new DuplicateKeyException("Already exists: "+id);
        
         // Store to file
         storeEntity(id, ctx.getInstance());
        
         return id;
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

         }
         catch(SQLException e)
         {
            if("23000".equals(e.getSQLState()))
            {
               throw new DuplicateKeyException("Unique key violation or invalid foreign key value: pk=" + ctx.getId());
            }
            else
            {
               throw new CreateException("Failed to create instance: pk=" +
                  ctx.getId() +
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

            try {
              stmt.setInt(1, id);
              ResultSet rs = stmt.executeQuery();
              try {
                 if (rs.next())
                    throw new DuplicateKeyException("EntityExc id " + pk.intValue() +
                                                    " already in database.");
               } finally {
                  rs.close();
               }
            } finally {
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

         {
         }
      }
     
      if (dublicate)
         throw new DuplicateKeyException ("Bean with id="+_id+" already exists.");

      return id;     
   }
View Full Code Here

Examples of javax.ejb.DuplicateKeyException

         {
         }
      }
     
      if (dublicate)
         throw new DuplicateKeyException ("Bean with id="+_id+" already exists.");

      return id;     
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.