Example usage for org.hibernate LockMode NONE

List of usage examples for org.hibernate LockMode NONE

Introduction

In this page you can find the example usage for org.hibernate LockMode NONE.

Prototype

LockMode NONE

To view the source code for org.hibernate LockMode NONE.

Click Source Link

Document

No lock required.

Usage

From source file:com.lm.lic.manager.hibernate.PerIndividualCustomerAutoMailConfigDAO.java

public void attachClean(PerIndividualCustomerAutoMailConfig instance) {
    log.debug("attaching clean PerIndividualCustomerAutoMailConfig instance");
    try {//www .  j a  va2s .c  om
        getHibernateTemplate().lock(instance, LockMode.NONE);
        log.debug("attach successful");
    } catch (RuntimeException re) {
        log.error("attach failed", re);
        throw re;
    }
}

From source file:com.lm.lic.manager.hibernate.ProductDAO.java

public void attachClean(Product instance) {
    log.debug("attaching clean Product instance");
    try {//w ww  .  j  a  v  a  2 s  .  com
        getHibernateTemplate().lock(instance, LockMode.NONE);
        log.debug("attach successful");
    } catch (RuntimeException re) {
        log.error("attach failed", re);
        throw re;
    }
}

From source file:com.lm.lic.manager.hibernate.RequestForLicenseDAO.java

public void attachClean(RequestForLicense instance) {
    log.debug("attaching clean RequestForLicense instance");
    try {//ww w. j a v a2 s  .  com
        getHibernateTemplate().lock(instance, LockMode.NONE);
        log.debug("attach successful");
    } catch (RuntimeException re) {
        log.error("attach failed", re);
        throw re;
    }
}

From source file:com.locke.library.persistence.dao.jpa.AbstractJpaDao.java

License:Apache License

/**
 * {@inheritDoc}//from ww  w. j a va2 s.c o m
 */
public void lock(final T object, final LockType lockType) {
    if (lockType == LockType.READ) {
        getEntityManager().lock(object, LockModeType.READ);
    } else if (lockType == LockType.WRITE) {
        getEntityManager().lock(object, LockModeType.WRITE);
    } else if (lockType == LockType.ATTACH) {
        final HibernateEntityManager manager = (HibernateEntityManager) getEntityManager();
        manager.getSession().lock(object, LockMode.NONE);
    } else {
        throw new UnsupportedOperationException("Unsupported lock type " + lockType);
    }
}

From source file:com.mg.framework.support.report.ReportUtils.java

License:Open Source License

/**
 * ? ? ?  ?  ??//w  w  w.  j  a  va2  s.  c  o  m
 *
 * @param entity ??
 * @return ? ?
 */
public static String createEntityParam(Object entity) {
    if (entity == null)
        return null;
    // ??  ?,       
    //${entity:<entity name>#<identificator value>}
    Session session = (Session) ServerUtils.getPersistentManager().getDelegate();
    session.lock(entity, LockMode.NONE);//reassociate a transient instance with a session
    return createEntityParam(session.getEntityName(entity), session.getIdentifier(entity));
}

From source file:com.npower.dm.hibernate.dao.ClientProvJobDAO.java

License:Open Source License

public void attachClean(ClientProvJobEntity instance) {
    log.debug("attaching clean ClientProvJobEntity instance");
    try {//from   www.j  a  v a2s . co m
        getSession().lock(instance, LockMode.NONE);
        log.debug("attach successful");
    } catch (RuntimeException re) {
        log.error("attach failed", re);
        throw re;
    }
}

From source file:com.npower.dm.hibernate.dao.ClientProvJobProfileDAO.java

License:Open Source License

public void attachClean(ClientProvJobProfile instance) {
    log.debug("attaching clean ClientProvJobProfile instance");
    try {//  ww  w  .j  a va2  s. co  m
        getSession().lock(instance, LockMode.NONE);
        log.debug("attach successful");
    } catch (RuntimeException re) {
        log.error("attach failed", re);
        throw re;
    }
}

From source file:com.npower.dm.hibernate.dao.ClientProvJobProfileParameterDAO.java

License:Open Source License

public void attachClean(ClientProvJobProfileParameter instance) {
    log.debug("attaching clean ClientProvJobProfileParameter instance");
    try {/*  w  ww  .  jav a  2  s .  co  m*/
        getSession().lock(instance, LockMode.NONE);
        log.debug("attach successful");
    } catch (RuntimeException re) {
        log.error("attach failed", re);
        throw re;
    }
}

From source file:com.npower.dm.hibernate.dao.ClientProvJobTargetDeviceDAO.java

License:Open Source License

public void attachClean(ClientProvJobTargetDeviceEntity instance) {
    log.debug("attaching clean ClientProvJobTargetDeviceEntity instance");
    try {/*from  w  w  w  . j av a 2s .co  m*/
        getSession().lock(instance, LockMode.NONE);
        log.debug("attach successful");
    } catch (RuntimeException re) {
        log.error("attach failed", re);
        throw re;
    }
}

From source file:com.npower.dm.hibernate.dao.ClientProvTemplateDAO.java

License:Open Source License

/**
 * @param instance/*  ww  w  .  ja v  a  2  s . c om*/
 * @throws DMException
 */
public void attachClean(ClientProvTemplateEntity instance) throws DMException {
    log.debug("attaching clean ClientProvTemplateEntity instance");
    try {
        getSession().lock(instance, LockMode.NONE);
        log.debug("attach successful");
    } catch (Exception re) {
        log.error("attach failed", re);
        throw new DMException("attach failed", re);
    }
}