Package org.apache.openjpa.util

Examples of org.apache.openjpa.util.OptimisticException


        case StoreException.OBJECT_EXISTS:
              return new ObjectExistsException(msg);
        case StoreException.OBJECT_NOT_FOUND:
              return new ObjectNotFoundException(msg);
        case StoreException.OPTIMISTIC:
              return new OptimisticException(msg);
        case StoreException.REFERENTIAL_INTEGRITY:
              return new ReferentialIntegrityException(msg);
          default:
              return new StoreException(msg);
        }
View Full Code Here


                if (f != null)
                    failed.add(f);
            }
        }
        if (opt && !failed.isEmpty())
            return new OptimisticException(failed, t);
        if (opt)
            return new OptimisticException(t);
        return new StoreException(_loc.get("rolled-back")).
            setNestedThrowables(t).setFatal(true);
    }
View Full Code Here

            break;
        case StoreException.OBJECT_NOT_FOUND:
            storeEx = new ObjectNotFoundException(failed);
            break;
        case StoreException.OPTIMISTIC:
            storeEx = new OptimisticException(failed);
            break;
        case StoreException.REFERENTIAL_INTEGRITY:
            storeEx = new ReferentialIntegrityException(msg);
            break;
        case StoreException.QUERY:
View Full Code Here

                    failed.add(f);
            }
        }
        if (opt && !failed.isEmpty()) {
            if(_suppressBatchOLELogging == true){
                return new OptimisticException(_loc.get("broker-suppressing-exceptions",t.length));
            }else{
                return new OptimisticException(failed, t);
            }
        }
        if (opt)
            return new OptimisticException(t);
       
        Object failedObject = null;
        if (t[0] instanceof OpenJPAException){
          failedObject = ((OpenJPAException)t[0]).getFailedObject();
        }
View Full Code Here

                if (f != null)
                    failed.add(f);
            }
        }
        if (opt && !failed.isEmpty())
            return new OptimisticException(failed, t);
        if (opt)
            return new OptimisticException(t);
        return new StoreException(_loc.get("rolled-back")).
            setNestedThrowables(t).setFatal(true);
    }
View Full Code Here

        row.flush(ps, _dict, _store);
        int count = ps.executeUpdate();
        if (count != 1) {
            Object failed = row.getFailedObject();
            if (failed != null)
                _exceptions.add(new OptimisticException(failed));
            else if (row.getAction() == Row.ACTION_INSERT)
                throw new SQLException(_loc.get("update-failed-no-failed-obj",
                    String.valueOf(count), row.getSQL(_dict)).getMessage());
        }
    }
View Full Code Here

            RowImpl row = (RowImpl) _batchedRows.get(batchedRowsBaseIndex + i);
            switch (cnt) {
            case Statement.EXECUTE_FAILED: // -3
                failed = row.getFailedObject();
                if (failed != null || row.getAction() == Row.ACTION_UPDATE)
                    _exceptions.add(new OptimisticException(failed));
                else if (row.getAction() == Row.ACTION_INSERT)
                    throw new SQLException(_loc.get(
                        "update-failed-no-failed-obj",
                        String.valueOf(count[i]), _batchedSql).getMessage());
                break;
View Full Code Here

        else if (dict.getSQLStates(StoreException.OBJECT_EXISTS).contains(e))
            return new ObjectExistsException(msg);
        else if (dict.getSQLStates(StoreException.OBJECT_NOT_FOUND).contains(e))
            return new ObjectNotFoundException(msg);
        else if (dict.getSQLStates(StoreException.OPTIMISTIC).contains(e))
            return new OptimisticException(msg);
        else if (dict.getSQLStates(StoreException.REFERENTIAL_INTEGRITY)
            .contains(e))
            return new ReferentialIntegrityException(msg);
        else
            return new StoreException(msg);
View Full Code Here

                updateIndicators(sm, (ClassMapping) sm.getMetaData(), rowMgr,
                    store, customs, true);
            } else if (sm.isVersionCheckRequired()) {
                if (!((ClassMapping) sm.getMetaData()).getVersion().
                    checkVersion(sm, store, false))
                    exceps = addException(exceps, new OptimisticException(sm.
                        getManagedInstance()));
            }
        } catch (SQLException se) {
            exceps = addException(exceps, SQLExceptions.getStore(se, dict));
        } catch (OpenJPAException ke) {
View Full Code Here

                    failed.add(f);
            }
        }
        if (opt && !failed.isEmpty()) {
            if(_suppressBatchOLELogging == true){
                return new OptimisticException(_loc.get("broker-suppressing-exceptions",t.length));
            }else{
                return new OptimisticException(failed, t);
            }
        }
        if (opt)
            return new OptimisticException(t);
        return new StoreException(_loc.get("rolled-back")).
            setNestedThrowables(t).setFatal(true);
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.util.OptimisticException

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.