Ejemplo n.º 1
0
 public void rollback(Logger log) {
   try {
     rollback();
   } catch (RetsServerException e) {
     log.warn("Exception", e);
   }
 }
Ejemplo n.º 2
0
 protected TableStandardName lookupTableStandardName(String standardName) {
   TableStandardName name = super.lookupTableStandardName(standardName);
   if (name == null) {
     SessionHelper helper = new SessionHelper(mSessions);
     try {
       Session session = helper.beginTransaction();
       List results =
           session.find(
               "SELECT name" + "  FROM TableStandardName name" + " WHERE name.name = ?",
               standardName,
               Hibernate.STRING);
       if (results.size() == 1) {
         name = (TableStandardName) results.get(1);
       }
     } catch (HibernateException e) {
       helper.rollback(System.err);
     } finally {
       helper.close(System.err);
     }
     if (name != null) {
       mTableStandardNames.put(standardName, name);
     }
   }
   return name;
 }
Ejemplo n.º 3
0
 public void rollback(PrintStream stream) {
   try {
     rollback();
   } catch (RetsServerException e) {
     e.printStackTrace(stream);
   }
 }
Ejemplo n.º 4
0
 public void close() throws RetsServerException {
   LOG.debug("close");
   if (mSession != null) {
     try {
       if (mTx != null) {
         rollback();
       }
       mSession.close();
     } catch (HibernateException e) {
       throw new RetsServerException(e);
     }
   }
 }
 private MSystem findSystemFromHibernate() {
   SessionHelper helper = new SessionHelper(mSessions);
   MSystem system = null;
   try {
     Session session = helper.beginTransaction();
     List results = new ArrayList();
     Iterator iterator = session.iterate("from MSystem");
     while (iterator.hasNext()) {
       results.add(iterator.next());
     }
     if (results.size() == 1) {
       system = (MSystem) results.get(0);
     }
   } catch (HibernateException e) {
     LOG.warn("Caught", e);
     helper.rollback(LOG);
   } finally {
     helper.close(LOG);
   }
   return system;
 }