Hi

2014-09-25 14:35 GMT+02:00 Daniel Kasmeroglu <[email protected]>:
> Hi there,
>
> I've got the following intent (similar to the JIRA/Confluence/Jenkins
> Homes):
>
> * Server starts with a property "myapp.home" pointing to a writable
> directory on the filesystem
> * Each module can get a data area "<myapp.home>/<module>"
> * One module provides a H2 database whereas the database files will be
> stored within the modules data area (f.e. "<myapp.home>/database")
>
> What I need is this:
>
> * Update DataSource setup according to the dynamically provided info
> * Run a migration process (I'm using Flyway here instead of OpenEJBs
> builtin ImportSql attempt)

import sql was not linked to migrations actually but more to
provisioning. Migrations need much more than it.

> * Setup JPA framework (EclipseLink in my case)
>
> Righ now the problem is that the Datasource is configured within the
> tomee.xml which requires the location of the db files directory which is
> unfortunately available at a later point:
>
>   <Resource id="ratiDS" type="DataSource">
>     JdbcDriver  = org.h2.Driver
>     JdbcUrl     = jdbc:h2:test
>     JtaManaged  = true
>   </Resource>
>
> I've tried to use an in-memory url ahead hoping to update the URL later
> on but the configured URL is stored within the 'DriverConnectionFactory'.
>
> Does someone here has an idea of a nice solution for this or am I simply
> overseeing something ?
>

Use your custom datasource:
http://rmannibucau.wordpress.com/2014/04/11/openejbtomee-custom-datasource-jta-integration/

Side note: this is also doable more or less with the same idea with
@DataSourceDefinition

>
> Best regards
>
> Daniel Kasmeroglu
>

Reply via email to