@Transactional @IntactFlushMode(FlushModeType.COMMIT) public PersisterStatistics saveOrUpdate( AnnotatedObject... annotatedObjects ) throws PersisterException { for (AnnotatedObject ao : annotatedObjects) { if (log.isDebugEnabled()) log.debug("Saving: "+DebugUtil.annotatedObjectToString(ao, false)); synchronize(ao); } commit(); // we reload the annotated objects by its AC // note: if an object does not have one, it is probably a duplicate for ( AnnotatedObject ao : annotatedObjects ) { reload( ao ); } if (log.isDebugEnabled()) log.debug(statistics); return statistics; }
@Transactional @IntactFlushMode(FlushModeType.COMMIT) public PersisterStatistics saveOrUpdate( AnnotatedObject... annotatedObjects ) throws PersisterException { for (AnnotatedObject ao : annotatedObjects) { if (log.isDebugEnabled()) log.debug("Saving: "+DebugUtil.annotatedObjectToString(ao, false)); synchronize(ao); } commit(); // we reload the annotated objects by its AC // note: if an object does not have one, it is probably a duplicate for ( AnnotatedObject ao : annotatedObjects ) { reload( ao ); } if (log.isDebugEnabled()) log.debug(statistics); return statistics; }
@Transactional public PersisterStatistics saveOrUpdate( AnnotatedObject ao ) { if (log.isDebugEnabled()) log.debug("Saving: "+DebugUtil.annotatedObjectToString( ao, false )); dataContext.getDaoFactory().getEntityManager().setFlushMode(FlushModeType.COMMIT); //dataContext.getDaoFactory().getDataConfig().setAutoFlush(false); try { synchronize( ao ); commit(); } finally { dataContext.getDaoFactory().getEntityManager().setFlushMode(FlushModeType.AUTO); } reload( ao ); return statistics; }
@Transactional public PersisterStatistics saveOrUpdate( AnnotatedObject ao ) { if (log.isDebugEnabled()) log.debug("Saving: "+DebugUtil.annotatedObjectToString( ao, false )); dataContext.getDaoFactory().getEntityManager().setFlushMode(FlushModeType.COMMIT); //dataContext.getDaoFactory().getDataConfig().setAutoFlush(false); try { synchronize( ao ); commit(); } finally { dataContext.getDaoFactory().getEntityManager().setFlushMode(FlushModeType.AUTO); } reload( ao ); return statistics; }