log.debug( "Commiting local transaction..." ); try { transaction.commit(); } catch ( IntactTransactionException e ) { throw new BioSourceServiceException( "Error while commiting transaction", e );
public void commitAllActiveTransactions() throws IntactTransactionException { Collection<DataConfig> dataConfigs = RuntimeConfig.getCurrentInstance( session ).getDataConfigs(); for ( DataConfig dataConfig : dataConfigs ) { DaoFactory daoFactory = getDaoFactory( dataConfig ); if ( daoFactory.isTransactionActive() ) { daoFactory.getCurrentTransaction().commit(); } } }
public void commitTransaction( String dataConfigName ) throws IntactTransactionException { DaoFactory daoFactory = getDaoFactory( dataConfigName ); if ( daoFactory.isTransactionActive() ) { try { if (getSession().getFlushMode() == FlushMode.MANUAL) { flushSession(); } daoFactory.getCurrentTransaction().commit(); } catch ( IntactTransactionException e ) { log.debug( "An Exception occured commiting" + e.getMessage() ); throw new IntactTransactionException( e ); } if ( log.isDebugEnabled() ) { log.debug( "Committed transaction: " + dataConfigName ); } } assert ( daoFactory.isTransactionActive() == false ); // flush the CvContext in to avoid lazy initialization errors clearCvContext(); }
IntactTransaction tx = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCurrentTransaction(); try { tx.commit(); } catch ( IntactTransactionException ie ) { log.error( "Exception commiting " + ie );
private static void checkSchemaCompatibility( DataConfig dataConfig, IntactSession session ) { SchemaVersion requiredVersion = dataConfig.getMinimumRequiredVersion(); DaoFactory daoFactory = DaoFactory.getCurrentInstance( session, RuntimeConfig.getCurrentInstance( session ).getDefaultDataConfig() ); IntactTransaction tx = daoFactory.beginTransaction(); DbInfo dbInfoSchemaVersion = daoFactory.getDbInfoDao().get( DbInfo.SCHEMA_VERSION ); try { tx.commit(); } catch ( IntactTransactionException e ) { log.error( "Exception commiting " + e ); } SchemaVersion schemaVersion; if ( dbInfoSchemaVersion == null ) { log.warn( "Schema version does not exist. Will be created" ); setSchemaVersionToBePersisted( session ); return; } try { schemaVersion = SchemaVersion.parse( dbInfoSchemaVersion.getValue() ); } catch ( Exception e ) { throw new IntactInitializationError( "Error getting schema version", e ); } log.info( "Schema Version: " + schemaVersion ); if ( !schemaVersion.isCompatibleWith( requiredVersion ) ) { throw new IntactInitializationError( "Database schema version " + requiredVersion + " is required" + " to use this version of intact-core. Schema version found: " + schemaVersion ); } }
log.debug( "Commiting local transaction..." ); try { transaction.commit(); } catch ( IntactTransactionException e ) { throw new BioSourceServiceException( "Error while commiting transaction", e );
CvContext.getCurrentInstance( session ).loadCommonCvObjects(); try { tx.commit(); } catch ( IntactTransactionException ie ) { log.error( "Exception commiting " + ie );
.getInstitutionDao().getByShortLabel( institutionLabel ); try { tx.commit(); } catch ( IntactTransactionException e ) { log.error( "Exception commiting " + e );