Package org.hibernate

Examples of org.hibernate.FlushMode.lessThan()


              new SpringSessionSynchronization(sessionHolder, sessionFactory, jdbcExceptionTranslator, false));
          sessionHolder.setSynchronizedWithTransaction(true);
          // Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
          // with FlushMode.NEVER, which needs to allow flushing within the transaction.
          FlushMode flushMode = session.getFlushMode();
          if (flushMode.lessThan(FlushMode.COMMIT) &&
              !TransactionSynchronizationManager.isCurrentTransactionReadOnly()) {
            session.setFlushMode(FlushMode.AUTO);
            sessionHolder.setPreviousFlushMode(flushMode);
          }
        }
View Full Code Here


                        jtaTm));
                sessionHolder.setSynchronizedWithTransaction(true);
                // Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
                // with FlushMode.NEVER, which needs to allow flushing within the transaction.
                FlushMode flushMode = session.getFlushMode();
                if (flushMode.lessThan(FlushMode.COMMIT)) {
                  session.setFlushMode(FlushMode.AUTO);
                  sessionHolder.setPreviousFlushMode(flushMode);
                }
              }
            }
View Full Code Here

              new SpringSessionSynchronization(sessionHolder, sessionFactory, jdbcExceptionTranslator, false));
          sessionHolder.setSynchronizedWithTransaction(true);
          // Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
          // with FlushMode.MANUAL, which needs to allow flushing within the transaction.
          FlushMode flushMode = session.getFlushMode();
          if (flushMode.lessThan(FlushMode.COMMIT) &&
              !TransactionSynchronizationManager.isCurrentTransactionReadOnly()) {
            session.setFlushMode(FlushMode.AUTO);
            sessionHolder.setPreviousFlushMode(flushMode);
          }
        }
View Full Code Here

                        jtaTm));
                sessionHolder.setSynchronizedWithTransaction(true);
                // Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
                // with FlushMode.NEVER, which needs to allow flushing within the transaction.
                FlushMode flushMode = session.getFlushMode();
                if (flushMode.lessThan(FlushMode.COMMIT)) {
                  session.setFlushMode(FlushMode.AUTO);
                  sessionHolder.setPreviousFlushMode(flushMode);
                }
              }
            }
View Full Code Here

      }

      if (!definition.isReadOnly() && !txObject.isNewSessionHolder()) {
        // We need AUTO or COMMIT for a non-read-only transaction.
        FlushMode flushMode = session.getFlushMode();
        if (flushMode.lessThan(FlushMode.COMMIT)) {
          session.setFlushMode(FlushMode.AUTO);
          txObject.getSessionHolder().setPreviousFlushMode(flushMode);
        }
      }
View Full Code Here

              new SpringSessionSynchronization(sessionHolder, sessionFactory, jdbcExceptionTranslator, false));
          sessionHolder.setSynchronizedWithTransaction(true);
          // Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
          // with FlushMode.NEVER, which needs to allow flushing within the transaction.
          FlushMode flushMode = session.getFlushMode();
          if (flushMode.lessThan(FlushMode.COMMIT) &&
              !TransactionSynchronizationManager.isCurrentTransactionReadOnly()) {
            session.setFlushMode(FlushMode.AUTO);
            sessionHolder.setPreviousFlushMode(flushMode);
          }
        }
View Full Code Here

                        jtaTm));
                sessionHolder.setSynchronizedWithTransaction(true);
                // Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
                // with FlushMode.NEVER, which needs to allow flushing within the transaction.
                FlushMode flushMode = session.getFlushMode();
                if (flushMode.lessThan(FlushMode.COMMIT)) {
                  session.setFlushMode(FlushMode.AUTO);
                  sessionHolder.setPreviousFlushMode(flushMode);
                }
              }
            }
View Full Code Here

              new SpringSessionSynchronization(sessionHolder, sessionFactory, jdbcExceptionTranslator, false));
          sessionHolder.setSynchronizedWithTransaction(true);
          // Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
          // with FlushMode.NEVER, which needs to allow flushing within the transaction.
          FlushMode flushMode = session.getFlushMode();
          if (flushMode.lessThan(FlushMode.COMMIT) &&
              !TransactionSynchronizationManager.isCurrentTransactionReadOnly()) {
            session.setFlushMode(FlushMode.AUTO);
            sessionHolder.setPreviousFlushMode(flushMode);
          }
        }
View Full Code Here

                        jtaTm));
                sessionHolder.setSynchronizedWithTransaction(true);
                // Switch to FlushMode.AUTO, as we have to assume a thread-bound Session
                // with FlushMode.NEVER, which needs to allow flushing within the transaction.
                FlushMode flushMode = session.getFlushMode();
                if (flushMode.lessThan(FlushMode.COMMIT)) {
                  session.setFlushMode(FlushMode.AUTO);
                  sessionHolder.setPreviousFlushMode(flushMode);
                }
              }
            }
View Full Code Here

      }

      if (!definition.isReadOnly() && !txObject.isNewSession()) {
        // We need AUTO or COMMIT for a non-read-only transaction.
        FlushMode flushMode = session.getFlushMode();
        if (flushMode.lessThan(FlushMode.COMMIT)) {
          session.setFlushMode(FlushMode.AUTO);
          txObject.getSessionHolder().setPreviousFlushMode(flushMode);
        }
      }
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.