提交 5fe06002 authored 作者: Thomas Mueller's avatar Thomas Mueller

Issue 180: when deserializing objects, the context class loader is used instead…

Issue 180: when deserializing objects, the context class loader is used instead of the default class loader if the system property "h2.useThreadContextClassLoader" is set. Thanks a lot to Noah Fontes for the patch!
上级 72034dfc
...@@ -1243,11 +1243,10 @@ public class TestLob extends TestBase { ...@@ -1243,11 +1243,10 @@ public class TestLob extends TestBase {
rs.next(); rs.next();
Object oa = rs.getObject(2); Object oa = rs.getObject(2);
assertEquals(TestLobObject.class.getName(), oa.getClass().getName()); assertEquals(TestLobObject.class.getName(), oa.getClass().getName());
TestLobObject a = (TestLobObject) oa;
Object ob = rs.getObject("DATA"); Object ob = rs.getObject("DATA");
TestLobObject b = (TestLobObject) ob; assertEquals(TestLobObject.class.getName(), ob.getClass().getName());
assertEquals("abc", a.data); assertEquals("TestLobObject: abc", oa.toString());
assertEquals("abc", b.data); assertEquals("TestLobObject: abc", ob.toString());
assertFalse(rs.next()); assertFalse(rs.next());
conn.createStatement().execute("drop table test"); conn.createStatement().execute("drop table test");
......
...@@ -19,4 +19,8 @@ class TestLobObject implements Serializable { ...@@ -19,4 +19,8 @@ class TestLobObject implements Serializable {
TestLobObject(String data) { TestLobObject(String data) {
this.data = data; this.data = data;
} }
public String toString() {
return "TestLobObject: " + data;
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论