Use connection-url to get database connection when connection properties for datasource-class is empty?

118 views
Skip to first unread message

Lin Gao

unread,
Sep 8, 2016, 10:18:27 AM9/8/16
to IronJacamar Developers
Hi folks,

  With JBJCA-1312[1] fixed, for non-xa datasource, at least one connection property must be specified if the datasource-class is defined, even when driver-class and connection-url are both defined at the same time. This will encourage people to use DataSource to get database connection[2] with some connection properties defined, like the servername, port, dbname, etc.

  However, this will fail the old configuration where the connection-url is used. Like in WildFly 10.0.0.Final, if datasource-class is defined in a driver element, the data-sources using the jdbc driver will have the datasource-class defined too. The configuration with only connection-url defined(no connection-properties defined) works fine in WildFly 10.0.0.Final(without including fix of JBJCA-1312), but it fails in WildFly 10.1.0.Final in which the fix is included[3].

  They may change their configuration to make it work, however in the compatibility point of view, I think we may try to use connection-url & driver-class to get the database connection if the connection properties are empty && datasource-class != null. A warning message can be printed to encourage users to use DataSource for database connection.

  Do you think it makes sense or is their potential problem if we do like this?

[1] https://issues.jboss.org/browse/JBJCA-1312
[2] https://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html
[3] https://issues.jboss.org/browse/WFLY-7018

Best Regards
--
Lin Gao
Software Engineer
JBoss by Red Hat

Stefano Maestri

unread,
Sep 9, 2016, 10:05:48 AM9/9/16
to IronJacamar Developers
 Hi Lin,

I perfectly understand your worries from a compatibility POV. On the other hand what you are suggesting is breaking what user expect, at least to some extent. 
Everything considered I agree with you, but we should print a BIG warning message, and explain details in the documentation.

So my vote is for the solution you are suggesting, I would kindly ask other community memebers to express their vote. If you don't want to argument just shot a post w/ +1 for suggested solution by Lin, -1 otherwise (forcing users to change configurations)

regards
S.

Flavia Rainone

unread,
Sep 13, 2016, 3:31:38 AM9/13/16
to IronJacamar Developers
+1

Lin Gao

unread,
Sep 22, 2016, 10:30:35 PM9/22/16
to IronJacamar Developers
Thank you for the feedback. ;-)

Yes, there will be a big WARN message to let users know what information is used to retrieve the database connection in this case.

Jira is created for this: https://issues.jboss.org/browse/JBJCA-1331

Best Regards
Lin Gao
Reply all
Reply to author
Forward
0 new messages