Using H2 with JUnit tests to test a web service

2010-06-25 Thread Calcul8r
I have developed a web service that I'm running in WebSphere application server. I want to test a method that simply retrieves all values from a database table and returns them as part of a payload in a response. I want to use an in-memory database for testing so the tests will be easily

Re: table locking

2010-06-25 Thread Thomas Mueller
Hi, Did you already read the documentation at http://h2database.com/html/advanced.html#transaction_isolation ? The documentation is not complete, I will add: = Read Committed = Read locks are released immediately after executing the statement, but write locks are kept until the transaction

Online backup and MVCC mode

2010-06-25 Thread Alex
Hi, I need to backup my embedded database online (while server is running). The database version is 1.1.117 and it is running in MVCC mode. As far as I understand I can't use SCRIPT SQL statement because it provides transactionally inconsistent backup in case of MVCC mode. Please confirm my

Re: Using H2 with JUnit tests to test a web service

2010-06-25 Thread Kerry Sainsbury
Are you saying that your test and your webservice need to talk to the same database? In that case, don't you need to need to use similar connection strings. Instead of jdbc:h2:mem: + DATABASE_NAME Try this: jdbc:h2:tcp://localhost/mem: + DATABASE_NAME Seems plausible to me -- but I haven't

Re: Using H2 with JUnit tests to test a web service

2010-06-25 Thread Calcul8r
Kerry, I don't really need to use a database in the testcase. I just wanted to make 100% certain that the database still existed after closing the connection in the set up method (and it does). I do want to use that same database in the web service and I do use the tcp://localhost in that url.

Re: Using the H2 SQL Parser

2010-06-25 Thread Thomas Mueller
Hi, I have a need to take a user-supplied SQL query and perform a few modifications to it before allowing it to execute against the database. Mostly, this consists of injecting in extra field names and conditions. I need this to be transparent to the user because the user cannot be relied on

Re: Help to connect to tcp server, [90067-134] session closed

2010-06-25 Thread Thomas Mueller
Hi, Hi all, i have some torubles to connect to my tcp remote server. I'm starting server with this command java -cp h2-1.2.136.jar org.h2.tools.Server -tcpAllowOthers Now im trying to connect to this server from a pc in LAN, my url is this jdbc:h2:tcp://192.168.0.2:9092/C:\h2db But i

Re: H2 in-memory database with MVCC enabled?

2010-06-25 Thread Thomas Mueller
Hi, Is it recommended to enable the MVCC parameter with an in-memory h2 database? It's possible, but usually it's not required. Does it provide any performance advantages? It depends on your use case. Why don't you try it? What is your recommendation at this point? I suggest to try it

Re: Using H2 with JUnit tests to test a web service

2010-06-25 Thread Kerry Sainsbury
I did some more testing -- it looks like your machine can't resolve localhost (don't laugh -- it happens!) I get the same error as you if I try to connect to the following: jdbc:h2:tcp://UNKNOWN_HOST/mem:testing;IFEXISTS=TRUE Cheers Kerry On Sat, Jun 26, 2010 at 12:44 AM, Calcul8r

Re: Help to connect to tcp server, [90067-134] session closed

2010-06-25 Thread Kerry Sainsbury
Can you client machine connect to the server machine via telnet? telnet 192.168.0.2 9092 Does this fail immediately, or does it connect? On Thu, Jun 24, 2010 at 11:36 AM, blow all...@gmail.com wrote: Hi all, i have some torubles to connect to my tcp remote server. I'm starting server with

Re: Using the H2 SQL Parser

2010-06-25 Thread Erin Drummond
The use case is to allow 3rd parties access to the same database, but to isolate the records that belong to each party automatically in each table (without their knowledge). When they create a table, extra fields are added that identifies the party and a few other things. When they execute an