Package javax.jdo

Examples of javax.jdo.Transaction.rollback()


      tx.commit();
    } catch (Exception e) {
      log.error(e.getMessage());
    } finally {
      if (tx.isActive()) {
        tx.rollback();
      }
      if (!pm.isClosed()) {
        pm.close();
      }
    }
View Full Code Here


      tx.commit();
    } catch (Exception e) {
      log.error(e.getMessage());
    } finally {
      if (tx.isActive()) {
        tx.rollback();
      }
      if (!pm.isClosed()) {
        pm.close();
      }
    }
View Full Code Here

            // ensure we log it here
            LOGGER.error(t);
            throw new RuntimeException(t);
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
            pm.close();
        }
        return result;
    }
View Full Code Here

            // make sure its logged
            LOGGER.error(t);
            throw new RuntimeException(t);
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
            pm.close();
        }
        return result;
    }
View Full Code Here

            // make sure its logged
            LOGGER.error(t);
            throw new RuntimeException(t);
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
            pm.close();
        }
    }
View Full Code Here

            // ensure we log it here
            LOGGER.error(t);
            throw new RuntimeException(t);
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
            pm.close();
        }
    }
View Full Code Here

            // ensure its logged
            LOGGER.error(t);
            throw new RuntimeException(t);
        } finally {
            if (tx.isActive()) {
                tx.rollback();
            }
            pm.close();
        }
    }
View Full Code Here

    try {
      trySetAnsiQuotesForMysql();
      isMySql = true;
    } catch (SQLException sqlEx) {
      LOG.info("MySQL check failed, assuming we are not on mysql: " + sqlEx.getMessage());
      tx.rollback();
      tx = pm.currentTransaction();
      tx.begin();
    }

    boolean isCompatibleDatastore = true;
View Full Code Here

      pm.newQuery(MTableColumnStatistics.class, "dbName == ''").execute();
      pm.newQuery(MPartitionColumnStatistics.class, "dbName == ''").execute();
    } catch (Exception ex) {
      isCompatibleDatastore = false;
      LOG.error("Database initialization failed; direct SQL is disabled", ex);
      tx.rollback();
    }
    if (isCompatibleDatastore) {
      // Self-test query. If it doesn't work, we will self-disable. What a PITA...
      String selfTestQuery = "select \"DB_ID\" from \"DBS\"";
      try {
View Full Code Here

        pm.newQuery("javax.jdo.query.SQL", selfTestQuery).execute();
        tx.commit();
      } catch (Exception ex) {
        isCompatibleDatastore = false;
        LOG.error("Self-test query [" + selfTestQuery + "] failed; direct SQL is disabled", ex);
        tx.rollback();
      }
    }

    this.isCompatibleDatastore = isCompatibleDatastore;
    this.isMySql = isMySql;
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.