private void dispatchEvent(final DatabaseTransactionEvent event) { try { transactionNotificationApi.dispatchNotification(event); } catch (final Exception e) { logger.warn("Failed to notify for event {}", event); } } }
public void rollback(final Handle handle) { getDelegate().rollback(handle); dispatchEvent(new DatabaseTransactionEvent(DatabaseTransactionEventType.ROLLBACK)); }
public DefaultPersistentBus(final DataSource dataSource, final Properties properties) { this(InTransaction.buildDDBI(dataSource), new DefaultClock(), new ConfigurationObjectFactory(properties).buildWithReplacements(PersistentBusConfig.class, ImmutableMap.<String, String>of("instanceName", "main")), new MetricRegistry(), new DatabaseTransactionNotificationApi()); }
if (event.getType() == DatabaseTransactionEventType.ROLLBACK) { transientInflightQRowIdCache.reset(); return;
this.prof = new Profiling<Long, RuntimeException>(); if (useInflightQueue && databaseTransactionNotificationApi != null) { databaseTransactionNotificationApi.registerForNotification(this);
databaseTransactionNotificationApi = new DatabaseTransactionNotificationApi(); dbi = new DBI(embeddedDB.getDataSource()); InTransaction.setupDBI(dbi);
public void commit(final Handle handle) { getDelegate().commit(handle); dispatchEvent(new DatabaseTransactionEvent(DatabaseTransactionEventType.COMMIT)); }