aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database/BaseObjectManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2022-02-13 23:34:25 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2022-02-13 23:34:25 -0800
commit1c73bae2e23242673e0a07cdbc2493700f134ceb (patch)
treed1105368628b5f64fabb657682df58f1641e4d54 /src/main/java/org/traccar/database/BaseObjectManager.java
parentde110b28ce8adb6ba875d88ede6e8f86dae4dd48 (diff)
downloadtrackermap-server-1c73bae2e23242673e0a07cdbc2493700f134ceb.tar.gz
trackermap-server-1c73bae2e23242673e0a07cdbc2493700f134ceb.tar.bz2
trackermap-server-1c73bae2e23242673e0a07cdbc2493700f134ceb.zip
New storage implementation
Diffstat (limited to 'src/main/java/org/traccar/database/BaseObjectManager.java')
-rw-r--r--src/main/java/org/traccar/database/BaseObjectManager.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main/java/org/traccar/database/BaseObjectManager.java b/src/main/java/org/traccar/database/BaseObjectManager.java
index be6310033..dd8b3bae4 100644
--- a/src/main/java/org/traccar/database/BaseObjectManager.java
+++ b/src/main/java/org/traccar/database/BaseObjectManager.java
@@ -16,7 +16,6 @@
*/
package org.traccar.database;
-import java.sql.SQLException;
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
@@ -29,6 +28,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.traccar.model.BaseModel;
+import org.traccar.storage.StorageException;
public class BaseObjectManager<T extends BaseModel> {
@@ -102,7 +102,7 @@ public class BaseObjectManager<T extends BaseModel> {
removeCachedItem(cachedItemId);
}
}
- } catch (SQLException error) {
+ } catch (StorageException error) {
LOGGER.warn("Error refreshing items", error);
} finally {
writeUnlock();
@@ -119,7 +119,7 @@ public class BaseObjectManager<T extends BaseModel> {
}
}
- public void addItem(T item) throws SQLException {
+ public void addItem(T item) throws StorageException {
dataManager.addObject(item);
addNewItem(item);
}
@@ -133,7 +133,7 @@ public class BaseObjectManager<T extends BaseModel> {
}
}
- public void updateItem(T item) throws SQLException {
+ public void updateItem(T item) throws StorageException {
dataManager.updateObject(item);
updateCachedItem(item);
}
@@ -147,7 +147,7 @@ public class BaseObjectManager<T extends BaseModel> {
}
}
- public void removeItem(long itemId) throws SQLException {
+ public void removeItem(long itemId) throws StorageException {
BaseModel item = getById(itemId);
if (item != null) {
dataManager.removeObject(baseClass, itemId);