提交 d893c6bd authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting, remove unused import

上级 e64b0d36
...@@ -11,7 +11,6 @@ import java.io.BufferedOutputStream; ...@@ -11,7 +11,6 @@ import java.io.BufferedOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.sql.Connection;
import org.h2.api.JavaObjectSerializer; import org.h2.api.JavaObjectSerializer;
import org.h2.command.Prepared; import org.h2.command.Prepared;
import org.h2.constant.ErrorCode; import org.h2.constant.ErrorCode;
......
...@@ -332,7 +332,7 @@ public class LobStorageBackend implements LobStorageInterface { ...@@ -332,7 +332,7 @@ public class LobStorageBackend implements LobStorageInterface {
assertNotHolds(conn.getSession()); assertNotHolds(conn.getSession());
// see locking discussion at the top // see locking discussion at the top
synchronized (database) { synchronized (database) {
synchronized(conn.getSession()) { synchronized (conn.getSession()) {
return new LobInputStream(lobId, byteCount); return new LobInputStream(lobId, byteCount);
} }
} }
...@@ -504,8 +504,8 @@ public class LobStorageBackend implements LobStorageInterface { ...@@ -504,8 +504,8 @@ public class LobStorageBackend implements LobStorageInterface {
b = compress.compress(b, compressAlgorithm); b = compress.compress(b, compressAlgorithm);
} }
int hash = Arrays.hashCode(b); int hash = Arrays.hashCode(b);
assertHolds(conn.getSession()); assertHoldsLock(conn.getSession());
assertHolds(database); assertHoldsLock(database);
block = getHashCacheBlock(hash); block = getHashCacheBlock(hash);
if (block != -1) { if (block != -1) {
String sql = "SELECT COMPRESSED, DATA FROM " + LOB_DATA + String sql = "SELECT COMPRESSED, DATA FROM " + LOB_DATA +
...@@ -592,7 +592,7 @@ public class LobStorageBackend implements LobStorageInterface { ...@@ -592,7 +592,7 @@ public class LobStorageBackend implements LobStorageInterface {
} }
} }
private static void assertHolds(Object lock) { static void assertHoldsLock(Object lock) {
if (!Thread.holdsLock(lock)) { if (!Thread.holdsLock(lock)) {
throw DbException.throwInternalError(); throw DbException.throwInternalError();
} }
...@@ -634,8 +634,8 @@ public class LobStorageBackend implements LobStorageInterface { ...@@ -634,8 +634,8 @@ public class LobStorageBackend implements LobStorageInterface {
// we have to take the lock on the session // we have to take the lock on the session
// before the lock on the database to prevent ABBA deadlocks // before the lock on the database to prevent ABBA deadlocks
assertHolds(conn.getSession()); assertHoldsLock(conn.getSession());
assertHolds(database); assertHoldsLock(database);
if (byteCount == -1) { if (byteCount == -1) {
String sql = "SELECT BYTE_COUNT FROM " + LOBS + " WHERE ID = ?"; String sql = "SELECT BYTE_COUNT FROM " + LOBS + " WHERE ID = ?";
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论