|
Any news on this topic? Thanks. As said by Martin, any news? Anyone looking for news should use the attached patch and report findings. Higher confidence == more likely to commit! i was able to successfully use h2 with hibernate using this patch @Chris: You do realize that the reporter and patch-creator in question here, Thomas Mueller, is the creator and developer of H2? And that his words and code thus are, in fact, The Truth? How strange of Hibernate that when a developer of a product comes with a patch concerning the integration to /his own product/, it isn't pretty much just insta-included?! @Endre, good point! totally agree with you. I can't imagine the author submitting a wrong patch. I even wonder if one day H2 will replace hsqldb inside JBoss AS... @Endre: I did not know this, so we'll definitely include the patch ASAP. I've always wondered why vendors that maintain/contribute Dialects just don't ship them with the JDBC driver (or with the whole database, in this case). I applied this patch to 3.3 and I get the same test results before and after - 17 errors, 3 failures. So perhaps we're missing some coverage. I'm interested in the test that fails when you run it twice. Can you shed some light on that? The test provided simply saves an instance that contains some basic columns (one being boolean). Certainly the 3.3 testsuite covers this. But we cannot rely on back-to-back runs to see a failure. Do you think you can conceive of a test that shows the error using a single run of the TS? Thanks again for the contribution, Thomas! Hi Chris, > we're missing some coverage Yes, it looks like. > Certainly the 3.3 testsuite covers this Yes, but the testsuite doesn't seem to test 'reloading'. It is probably possible to test this feature, but I'm not familiar with the Hibernate test suite. If you want me to write a better test case then it would take some more time I'm afraid... > why vendors that maintain/contribute Dialects just don't ship them The dialect is included in H2 under h2/src/tools/org/hibernate/dialect/H2Dialect.java.txt (I renamed it to .txt so that I don't have to add a dependency to Hibernate). I could include the class file in the h2*.jar, but that would not help if the Hibernate jar file is loaded first. Also, writing a dialect that works with all versions of Hibernate could be hard. Regards, Thomas, what's the nature of this "problem with the BIT / BOOLEAN data type"? For H2, BIT and BOOLEAN are the same data type. The same as CHAR and CHARACTER are the same data type. If you create a table like this: CREATE TABLE TEST(B BIT, C CHARACTER); and then retrieve the meta data (using DatabaseMetaData) and re-construct the CREATE TABLE statement you get: CREATE TABLE TEST(B BOOLEAN, C CHAR); However Hibernate doesn't 'know' currently that BIT is BOOLEAN is the same, because of the H2Dialect. So when you start the test again, Hibernate says that the data type BOOLEAN is not compatible with BIT. By the way this problem was found by Dan Allen. He works for Red Hat / JBoss now. See also http://www.manning-sandbox.com/thread.jspa?threadID=26080&tstart=0 Please tell me if you have more question. A work-around while waiting for the patch to be incorporated in Hibernate would simply be to include this patch in your own application, then change the hibernate.dialect property accordingly. Hibernate would not load this class until the Hibernate configuration is assembled in your application. If it is okay, why don't you apply it? |
||||||||||||||||||||||||||||||||||||||||||||||||||
For convenience, here the patched H2Dialect file.