Lucee/Tomcat v. Lucee/Jetty H2 Embedded Mode Issue

When I create a H2 Database in Embedded Mode on Lucee/Jetty, the h2 files
are placed in the appropriately named path. For example, if I specify
path=db/ when creating a datasource via the Lucee Admin, a “db/” directory
is created relative to the Lucee/Jetty directory structure and the h2 files
are placed there.

However, on Lucee/Tomcat, using the same exact setup, the path is not
created relative to the Lucee/Tomcat directory structure, and the h2 files
are placed elsewhere on the OS filesystem.

Is this expected? Or, is there some variable/syntax I should use for the
Lucee/Tomcat setup to have the files created relative to its directory
structure?

Thanks,
Steve

@Jeroen, and yes, I’ve verified that both the Lucee/Tomcat Express and
Lucee/Jetty Express are both using the same H2 jar file (v1.3.172).On Tuesday, March 10, 2015 at 5:40:58 AM UTC-5, Jeroen Knoef wrote:

Hi Steve,

Does it work if you create the datasource programmatically, like this:

this.datasources.myDatasource = {
class: “org.h2.Driver”,
connectionString: “jdbc:h2:#myPath#;MODE=MySQL”,
username: “sa”,
password: “”
}

This works for me (although I’m not using Jetty). Or you could edit the
connection string directly in the admin.

Are you sure Jetty and Tomcat are on the same jar versions?

This is strange. So, when I create the datasource programmatically, a
folder is created just under my Lucee/Tomcat Express directory. However,
when I create it using the UI, it doesn’t get created there, like I would
expect it to be, even though the path is the same. The “db/” directory gets
created elsewhere on my filesystem.

https://lh6.googleusercontent.com/-q9jfYJlrugI/VP8ee6Dv47I/AAAAAAAAAQs/-ELI26JxJCc/s1600/lucee-h2-db-path.pngOn Tuesday, March 10, 2015 at 5:40:58 AM UTC-5, Jeroen Knoef wrote:

Hi Steve,

Does it work if you create the datasource programmatically, like this:

this.datasources.myDatasource = {
class: “org.h2.Driver”,
connectionString: “jdbc:h2:#myPath#;MODE=MySQL”,
username: “sa”,
password: “”
}

This works for me (although I’m not using Jetty). Or you could edit the
connection string directly in the admin.

Are you sure Jetty and Tomcat are on the same jar versions?

Hi Steve,

Does it work if you create the datasource programmatically, like this:

this.datasources.myDatasource = {
class: “org.h2.Driver”,
connectionString: “jdbc:h2:#myPath#;MODE=MySQL”,
username: “sa”,
password: “”
}

This works for me (although I’m not using Jetty). Or you could edit the
connection string directly in the admin.

Are you sure Jetty and Tomcat are on the same jar versions?

This is a result of the different containers resolving “/” differently,
I believe. If you use an absolute path, you should be good to go I
think. Somebody asked for the “tokens” like {lucee-web} to work
/everywhere/, which I think would be fantastic, and go a long way
towards being able to abstract various settings like these.

-DennyOn 3/10/15 10:46 AM, Steve Withington wrote:

@Jeroen, and yes, I’ve verified that both the Lucee/Tomcat Express and
Lucee/Jetty Express are both using the same H2 jar file (v1.3.172).

On Tuesday, March 10, 2015 at 5:40:58 AM UTC-5, Jeroen Knoef wrote:

Hi Steve,

Does it work if you create the datasource programmatically, like this:

this.datasources.myDatasource = {
class: "org.h2.Driver",
connectionString: "jdbc:h2:#myPath#;MODE=MySQL",
username: "sa",
password: ""
}

This works for me (although I'm not using Jetty). Or you could edit
the connection string directly in the admin.

Are you sure Jetty and Tomcat are on the same jar versions?


You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+unsubscribe@googlegroups.com
mailto:lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com
mailto:lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/b8f36091-f195-427a-884c-aeb2d1fdbc57%40googlegroups.com
https://groups.google.com/d/msgid/lucee/b8f36091-f195-427a-884c-aeb2d1fdbc57%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout.