Removed deprecated setFlushMode from Session and SharedSessionContractImplementor
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
8b0f70f066
commit
13527366c9
|
@ -117,7 +117,7 @@ public interface Session extends SharedSessionContract, EntityManager {
|
|||
/**
|
||||
* Force this session to flush. Must be called at the end of a unit of work,
|
||||
* before the transaction is committed. Depending on the current
|
||||
* {@link #setFlushMode(FlushMode) flush mode}, the session might automatically
|
||||
* {@link #setHibernateFlushMode(FlushMode)} flush mode}, the session might automatically
|
||||
* flush when {@link Transaction#commit()} is called, and it is not necessary
|
||||
* to call this method directly.
|
||||
* <p>
|
||||
|
@ -128,25 +128,6 @@ public interface Session extends SharedSessionContract, EntityManager {
|
|||
*/
|
||||
void flush();
|
||||
|
||||
/**
|
||||
* Set the current {@link FlushMode flush mode} for this session.
|
||||
* <p>
|
||||
* <em>Flushing</em> is the process of synchronizing the underlying persistent
|
||||
* store with persistable state held in memory. The current flush mode determines
|
||||
* when the session is automatically flushed.
|
||||
* <p>
|
||||
* The {@link FlushMode#AUTO default flush mode} is sometimes unnecessarily
|
||||
* aggressive. For a logically "read only" session, it's reasonable to set the
|
||||
* session's flush mode to {@link FlushMode#MANUAL} at the start of the session
|
||||
* in order to avoid some unnecessary work.
|
||||
*
|
||||
* @param flushMode the new {@link FlushMode}
|
||||
*
|
||||
* @deprecated use {@link #setHibernateFlushMode(FlushMode)}
|
||||
*/
|
||||
@Deprecated(since="5.2")
|
||||
void setFlushMode(FlushMode flushMode);
|
||||
|
||||
/**
|
||||
* Set the current {@link FlushModeType JPA flush mode} for this session.
|
||||
* <p>
|
||||
|
|
|
@ -278,7 +278,7 @@ public abstract class AbstractPersistentCollection<E> implements Serializable, P
|
|||
final SessionFactoryImplementor sf = SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
|
||||
final SharedSessionContractImplementor session = (SharedSessionContractImplementor) sf.openSession();
|
||||
session.getPersistenceContextInternal().setDefaultReadOnly( true );
|
||||
session.setFlushMode( FlushMode.MANUAL );
|
||||
session.setHibernateFlushMode( FlushMode.MANUAL );
|
||||
return session;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,11 +264,6 @@ public class SessionDelegatorBaseImpl implements SessionImplementor {
|
|||
return delegate.getHibernateFlushMode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFlushMode(FlushMode fm) {
|
||||
delegate.setHibernateFlushMode( fm );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lock(Object entity, LockModeType lockMode) {
|
||||
delegate.lock( entity, lockMode );
|
||||
|
|
|
@ -336,24 +336,6 @@ public interface SharedSessionContractImplementor
|
|||
|
||||
boolean isCriteriaCopyTreeEnabled();
|
||||
|
||||
/**
|
||||
* Set the flush mode for this session.
|
||||
* <p/>
|
||||
* The flush mode determines the points at which the session is flushed.
|
||||
* <i>Flushing</i> is the process of synchronizing the underlying persistent
|
||||
* store with persistable state held in memory.
|
||||
* <p/>
|
||||
* For a logically "read only" session, it is reasonable to set the session's
|
||||
* flush mode to {@link FlushMode#MANUAL} at the start of the session (in
|
||||
* order to achieve some extra performance).
|
||||
*
|
||||
* @param flushMode the new flush mode
|
||||
*
|
||||
* @deprecated use {@link #setHibernateFlushMode(FlushMode)} instead
|
||||
*/
|
||||
@Deprecated(since = "5.2")
|
||||
void setFlushMode(FlushMode flushMode);
|
||||
|
||||
/**
|
||||
* Get the flush mode for this session.
|
||||
* <p/>
|
||||
|
|
|
@ -615,11 +615,6 @@ public abstract class AbstractSharedSessionContract implements SharedSessionCont
|
|||
return getFactory().getJdbcServices();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFlushMode(FlushMode flushMode) {
|
||||
setHibernateFlushMode( flushMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public FlushModeType getFlushMode() {
|
||||
checkOpen();
|
||||
|
|
|
@ -503,11 +503,6 @@ public class StatelessSessionImpl extends AbstractSharedSessionContract implemen
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFlushMode(FlushMode fm) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHibernateFlushMode(FlushMode flushMode) {
|
||||
throw new UnsupportedOperationException();
|
||||
|
|
|
@ -196,7 +196,7 @@ public abstract class AbstractLazyInitializer implements LazyInitializer {
|
|||
SessionFactoryImplementor sf = SessionFactoryRegistry.INSTANCE.getSessionFactory( sessionFactoryUuid );
|
||||
SharedSessionContractImplementor session = (SharedSessionContractImplementor) sf.openSession();
|
||||
session.getPersistenceContext().setDefaultReadOnly( true );
|
||||
session.setFlushMode( FlushMode.MANUAL );
|
||||
session.setHibernateFlushMode( FlushMode.MANUAL );
|
||||
|
||||
boolean isJTA = session.getTransactionCoordinator().getTransactionCoordinatorBuilder().isJta();
|
||||
|
||||
|
|
|
@ -221,7 +221,7 @@ public class EntityManagerTest extends BaseEntityManagerFunctionalTestCase {
|
|||
EntityManager em = getOrCreateEntityManager();
|
||||
em.setFlushMode( FlushModeType.COMMIT );
|
||||
assertEquals( FlushModeType.COMMIT, em.getFlushMode() );
|
||||
( (Session) em ).setFlushMode( FlushMode.ALWAYS );
|
||||
( (Session) em ).setHibernateFlushMode( FlushMode.ALWAYS );
|
||||
assertEquals( em.getFlushMode(), FlushModeType.AUTO );
|
||||
em.close();
|
||||
}
|
||||
|
|
|
@ -470,7 +470,7 @@ public class ProxyTest extends BaseCoreFunctionalTestCase {
|
|||
s.close();
|
||||
|
||||
s = openSession();
|
||||
s.setFlushMode( FlushMode.MANUAL );
|
||||
s.setHibernateFlushMode( FlushMode.MANUAL );
|
||||
t = s.beginTransaction();
|
||||
// load the last container as a proxy
|
||||
Container proxy = s.load( Container.class, lastContainerId );
|
||||
|
|
|
@ -46,6 +46,6 @@ public abstract class AbstractFlushTest extends BaseEnversJPAFunctionalTestCase
|
|||
@Before
|
||||
public void initFlush() throws IOException {
|
||||
Session session = getSession( getEntityManager() );
|
||||
session.setFlushMode( getFlushMode() );
|
||||
session.setHibernateFlushMode( getFlushMode() );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue