wildfly / wildfly-glow

Galleon Layers Output from War: Automatic discover of WildFly provisioning information from an application.
Apache License 2.0
7 stars 7 forks source link

jakarta.annotation.sql.DataSourceDefinition can bring datasource #91

Open jfdenise opened 2 days ago

jfdenise commented 2 days ago

Such definition present in source code would resolve some datasources referenced from persistence.xml. One issue with DataSourceDefinition is that they don't define the driver in use. For example:

@DataSourceDefinition(name="java:jboss/datasources/batch-processingDS",
        className="org.h2.jdbcx.JdbcDataSource",
        url="jdbc:h2:mem:batch-processing;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1",
        user="sa",
        password="sa"
)

The URL needs to be parsed to understand that the h2 driver is required.

jamezp commented 2 days ago

Parsing the url seems a bit tricky TBH. I kind of think we should maybe have a default, h2, and potentially fail if the url doesn't start with jdbc:h2 and require a defined database driver.