Best approach to embed Hypersonic in Webapp?
"Eric Pugh" <[email protected]> Tue, 10 Feb 2004 23:15:25 +0100
| Newsgroups | gmane.comp.java.hsqldb.user,gmane.mail.eyebrowse.devel |
|---|---|
| Message-ID | <005301c3f023$bd938870$6c0111ac@IQUITOS> |
Hi all, I have recently been working on embedding Hypersonic in the Scarab Issue Tracker (http://scarab.tigris.org). We support multiple databases including MySQL and PostgreSQL, but for use in our "all in one download" having a preconfigured Hypersonic database would be great. Right now I am faced with two challenges: 1) I am running unit tests that leverage Hypersonic. Is there any way to prevent Hypersonic from storing the changes made to it? I have a scarab.script file that preloads all the tables and data needed for the unit tests. However, for each unit test, I want the changes to only persist in memory, not be written out to the scarab.script file. Right now I have to make sure that all changes to the database are undone at the end of the unit test, or don't affect the next unit test. 2) How to start Hypersonic in a multiuser mode. I tried starting it with the jdbc URL: jdbc:hsqldb:c:\scarab however my unit tests use DBCP and made multiple connections which failed. So now I start with the jdbc URL: jdbc:hsqldb:hsql://localhost, however that requires me to manually start up Scarab seperately. I was thinking of creating another servlet that started before the Scarab servlet that would do what my batch file: @java -classpath hsqldb-1.7.1.jar org.hsqldb.Server -database scarab does. Does anyone have any sample code to share of using Hypersonic in a WAR file? Eric Pugh ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn