Package org.openbp.server.persistence

Examples of org.openbp.server.persistence.TransactionGuard.doCatch()


      pc.deleteObject(dbModelItem);
    }
    catch (PersistenceException e)
    {
      tg.doCatch();
      throw new ModelException("DatabaseOperation", "Error saving descriptor of component '" + item.getQualifier() + "' to the database: "
        + e.getMessage(), e);
    }
    finally
    {
View Full Code Here


      readModelsFromDatabase(pc);
      readItemsFromDatabase(pc);
    }
    catch (PersistenceException e)
    {
      tg.doCatch();
      throw new ModelException("DatabaseOperation", "Error loading models from the database: " + e.getMessage(), e);
    }
    finally
    {
      tg.doFinally();
View Full Code Here

      Collection result = hc.list();
      return result.iterator();
    }
    catch (HibernateException e)
    {
      tg.doCatch();
      throw createLoggedException(e);
    }
    finally
    {
      tg.doFinally();
View Full Code Here

      getHibernateSession().saveOrUpdate(o);
      return o;
    }
    catch (HibernateException e)
    {
      tg.doCatch();
      throw createLoggedException(e);
    }
    finally
    {
      tg.doFinally();
View Full Code Here

      return model;
    }
    catch (PersistenceException e)
    {
      tg.doCatch();
      throw new ModelException("DatabaseOperation", "Error loading model from the database: " + e.getMessage(), e);
    }
    finally
    {
      tg.doFinally();
View Full Code Here

    {
      getHibernateSession().delete(o);
    }
    catch (HibernateException e)
    {
      tg.doCatch();
      throw createLoggedException(e);
    }
    finally
    {
      tg.doFinally();
View Full Code Here

      return item;
    }
    catch (PersistenceException e)
    {
      tg.doCatch();
      throw new ModelException("DatabaseOperation", "Error loading models from the database: " + e.getMessage(), e);
    }
    finally
    {
      tg.doFinally();
View Full Code Here

      int count = query.executeUpdate();
      return count;
    }
    catch (HibernateException e)
    {
      tg.doCatch();
      throw createLoggedException(e);
    }
    finally
    {
      tg.doFinally();
View Full Code Here

      Collection root = query.list();
      return root.iterator();
    }
    catch (HibernateException e)
    {
      tg.doCatch();
      throw createLoggedException(e);
    }
    finally
    {
      tg.doFinally();
View Full Code Here

        }
        getDataContext().invalidateObjects(Collections.singletonList(obj));
      }
      catch (CayenneRuntimeException e)
      {
        tg.doCatch();

        // We assume that the object doesn't exist any more.
        String msg = LogUtil.error(getClass(), "Persistence error.", e);
        throw new PersistentObjectNotFoundException(msg, e);
      }
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.