From 987e5b79304062308a5d304a57dabcce97654867 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 17 Oct 2006 00:08:26 +0000 Subject: More work on automatic triggers. --- src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java | 2 +- src/main/java/com/amazon/carbonado/repo/logging/LoggingStorage.java | 3 ++- src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo') diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java index df61ecf..b06bf99 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCStorage.java @@ -96,7 +96,7 @@ class JDBCStorage extends StandardQueryFactory final TriggerManager mTriggerManager; JDBCStorage(JDBCRepository repository, JDBCStorableInfo info) - throws SupportException + throws SupportException, RepositoryException { super(info.getStorableType()); mRepository = repository; diff --git a/src/main/java/com/amazon/carbonado/repo/logging/LoggingStorage.java b/src/main/java/com/amazon/carbonado/repo/logging/LoggingStorage.java index 47d6bb1..3f807c2 100644 --- a/src/main/java/com/amazon/carbonado/repo/logging/LoggingStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/logging/LoggingStorage.java @@ -22,6 +22,7 @@ import com.amazon.carbonado.FetchException; import com.amazon.carbonado.PersistException; import com.amazon.carbonado.Query; import com.amazon.carbonado.Repository; +import com.amazon.carbonado.RepositoryException; import com.amazon.carbonado.Storable; import com.amazon.carbonado.Storage; @@ -35,7 +36,7 @@ import com.amazon.carbonado.spi.WrappedStorage; class LoggingStorage extends WrappedStorage { final LoggingRepository mRepo; - LoggingStorage(LoggingRepository repo, Storage storage) { + LoggingStorage(LoggingRepository repo, Storage storage) throws RepositoryException { super(storage, repo.mTriggerFactories); mRepo = repo; } diff --git a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java index b885399..20ab89f 100644 --- a/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java +++ b/src/main/java/com/amazon/carbonado/repo/sleepycat/BDBStorage.java @@ -131,7 +131,7 @@ abstract class BDBStorage implements Storage, Storag mRepository = repository; mType = type; mRawSupport = new Support(repository, this); - mTriggerManager = new TriggerManager(type, repository.mTriggerFactories); + mTriggerManager = new TriggerManager(); try { // Ask if any lobs via static method first, to prevent stack // overflow that occurs when creating BDBStorage instances for @@ -466,6 +466,9 @@ abstract class BDBStorage implements Storage, Storag mPrimaryDatabase = primaryDatabase; mQueryEngine = new QueryEngine(getStorableType(), mRepository); + + // Don't install automatic triggers until we're completely ready. + mTriggerManager.addTriggers(getStorableType(), mRepository.mTriggerFactories); } protected S instantiate(byte[] key, byte[] value) throws FetchException { -- cgit v1.2.3