Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 277808 - [DB] Support for H2 Database
Summary: [DB] Support for H2 Database
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.net4j.db (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: RC4   Edit
Assignee: Eike Stepper CLA
QA Contact:
URL:
Whiteboard: Appealing to a Broader Community
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-26 04:25 EDT by Kai Schlamp CLA
Modified: 2010-06-29 04:16 EDT (History)
2 users (show)

See Also:
stepper: galileo+
stepper: review+


Attachments
Initial H2 adapter implementation (113.39 KB, application/zip)
2009-05-26 07:40 EDT, Kai Schlamp CLA
stepper: iplog+
Details
Initial H2 adapter test (3.06 KB, text/plain)
2009-05-26 07:41 EDT, Kai Schlamp CLA
no flags Details
DBAdapter-Project-to-import (27.18 KB, application/octet-stream)
2009-06-05 09:31 EDT, Stefan Winkler CLA
no flags Details
Patch to cdo.tests.db (5.77 KB, patch)
2009-06-05 09:37 EDT, Stefan Winkler CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Schlamp CLA 2009-05-26 04:25:08 EDT
Support H2 as a database backend (http://www.h2database.com/html/main.html).
Comment 1 Kai Schlamp CLA 2009-05-26 07:36:34 EDT
I started working on the H2 database support. 

I started using the H2 driver from Spring OSGI repository (com.springsource.org.h2)but having the same "Unsatisfied version constraint" problems as we had with the org.eclipse.net4j.db.mysql bundle (does in the meantime someone know why that happens?).

So I directly use the driver from the H2 site (they also provide an OSGI bundle).

The H2 db adapter is mostly a mix of derby and hsqldb adapter. 

I also wrote a test for my for the H2 db adapter, but it finished with about 40 errors.
I also ran the HSQLDB test, but those also about 40 errors and failures. Is the HSQLDB support for CDO anyhow considered as stable?

Is there any db adapter test that finishes without any errors?
Comment 2 Kai Schlamp CLA 2009-05-26 07:40:30 EDT
Created attachment 137138 [details]
Initial H2 adapter implementation
Comment 3 Kai Schlamp CLA 2009-05-26 07:41:30 EDT
Created attachment 137139 [details]
Initial H2 adapter test
Comment 4 Eike Stepper CLA 2009-05-26 08:33:59 EDT
I don't have the time to look into your code now because it's RC2 day. If you're referring to CDO tests (as opposed to possible Net4j DB tests) then we should ask Stefan.
Comment 5 Eike Stepper CLA 2009-06-03 07:51:16 EDT
I'm willing to prepare the legal process for H2 usage. Where can I find related information, e.g. project web page, license URL? 

And I will need a zip of the sources for submission to IPZilla. Please do not attach it here as it could violate the terms of use. Please send it to me directly via email. This is what IPZilla will ask me:

"This CQ is awaiting source code. Please attach it to this CQ at your earliest
convenience. Please note: your attachment must not contain nested ZIP, JAR, TAR
or any other type of compressed files.  Please remove nested ZIP files if they
are not required prior to submitting the attachment, or unzip the contents and
delete the nested ZIP file.  Content originating from another package (ZIPs,
JARs or other) should be removed and requested via a separate CQ. "
Comment 6 Eike Stepper CLA 2009-06-04 10:50:45 EDT
Our CQ for H2 support was approved: http://dev.eclipse.org/ipzilla/show_bug.cgi?id=3377
Comment 7 Stefan Winkler CLA 2009-06-05 09:30:37 EDT
Ok, I had a look at the plugin and testcase. I replaced a few occurrences of Cut&Paste errors (Mainly HSQLDB -> H2 renamings). The code as it is seems ok to me. Copyright notice etc. are there and the code is mainly copied from existing DBAdapters.

I also ran the tests. Errors/Fails = 29/6 which is typical for DBStore implementations (due to missing or only partially implemented features). 

Eike, please review. I don't know, if you need a formal statement from Kai before putting it into CVS, this is why, I did not do so. 

The ZIP-Attachment can be imported as an existing project from archive.
The testcase is a patch against the test.db project.
I stripped the -feature project from the ZIP for now, as there are no features for the other databases (and because I don't know much about the feature mechanism).

I also don't really know, where to get the cited H2 OSGi-Bundle - I tested with a self-created support plugin which exports the org.h2 and org.h2.jdbcx packages.
Comment 8 Stefan Winkler CLA 2009-06-05 09:31:43 EDT
Created attachment 138401 [details]
DBAdapter-Project-to-import

Ready for review
Comment 9 Stefan Winkler CLA 2009-06-05 09:37:01 EDT
Created attachment 138402 [details]
Patch to cdo.tests.db

Ready for review (includes MANIFEST changes and run configuration for H2 testsuite)
Comment 10 Kai Schlamp CLA 2009-06-05 11:30:58 EDT
> Eike, please review. I don't know, if you need a formal statement from Kai
> before putting it into CVS, this is why, I did not do so. 

What formal statement?

> I also don't really know, where to get the cited H2 OSGi-Bundle - I tested with
> a self-created support plugin which exports the org.h2 and org.h2.jdbcx
> packages.

Just download the H2 "All platforms" from the mainsite (http://www.h2database.com/html/main.html). The OSGi bundle is inside the zip (/h2/bin/h2-1.1.114.jar).

Comment 11 Eike Stepper CLA 2009-06-05 11:38:06 EDT
Kai, can you please confirm here that:

1) The number of lines that you changed (after copying from HSQLDB) is smaller than 250.

2) You are the only author of these changed lines.

3) You apply the EPL to these changed lines.

If your contribution is bigger than 250 lines, it is not considered small anymore and we need to go through a bigger legal process with paperwork for you.
Comment 12 Kai Schlamp CLA 2009-06-05 11:40:03 EDT
(In reply to comment #11)
> Kai, can you please confirm here that:
> 
> 1) The number of lines that you changed (after copying from HSQLDB) is smaller
> than 250.
Confirmed.
> 
> 2) You are the only author of these changed lines.
Confirmed.
> 
> 3) You apply the EPL to these changed lines.
Confirmed.

:-)

Comment 13 Eike Stepper CLA 2009-06-05 11:54:36 EDT
BTW. the newer zip does not contain the fature anymore! I made a new one ;-(
Comment 14 Eike Stepper CLA 2009-06-05 13:11:44 EDT
Added h2 adapter plugin and its feature to CVS.
Added h2 engine bundle and its feature to http://net4j.sourceforge.net/update
Comment 15 Eike Stepper CLA 2009-06-05 13:17:06 EDT
Added tests patch.
Adjusted PSFs.

Committed to HEAD.
Comment 16 Eike Stepper CLA 2009-06-05 13:32:01 EDT
Updated IP log.
Comment 17 Eike Stepper CLA 2009-06-10 03:01:37 EDT
Fix available in NET4J 2.0.0RC4
Comment 18 Eike Stepper CLA 2009-06-27 11:51:44 EDT
Generally available.