Code example for SessionFactory

Methods: hashCode

0
	 */ 
	private boolean participate = false;
	 
	public void openSession() { 
		log.debug("HibernateContext: Opening Hibernate Session");
		if (TransactionSynchronizationManager.hasResource(sessionFactory)) {
			if (log.isDebugEnabled()) {
				log.debug("Participating in existing session (" + sessionFactory.hashCode() + ")");
			} 
			participate = true;
		} else { 
			if (log.isDebugEnabled()) {
				log.debug("Registering session with synchronization manager (" + sessionFactory.hashCode() + ")");
			} 
			Session session = SessionFactoryUtils.getSession(sessionFactory, true);
			session.setFlushMode(FlushMode.MANUAL);
			TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session));
		} 
	} 
	 
	/** 
	 * @see org.openmrs.api.context.Context#closeSession() 
Connect your IDE to all the code out there  Get Codota for Java