Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement FirebirdConnectionProperties for new ConnectionPoolDataSource and XADataSource [JDBC198] #247

Closed
firebird-automations opened this issue Nov 13, 2011 · 6 comments

Comments

@firebird-automations
Copy link

Submitted by: @mrotteveel

The older datasources implement the interface FirebirdConnectionProperties to specify properties common to all datasources. The new implementations of ConnectionPoolDataSource and XADataSource does not implement this interface.

The JDBC 4.1 spec states:
"DataSource properties are not intended to be directly accessible by JDBC clients.
This design is reinforced by defining the access methods on the implementation
class rather than on the public DataSource interface used by applications.
Furthermore, the object that the client manipulates can be a wrapper that only
implements the DataSource interface. The setter and getter methods for the
properties need not be exposed to the client."

For migration purposes it would however be better if the new datasources implement this interface and all its properties (potentially marking some of the properties as deprecated on the interface).

For example: For unclear reasons the older datasources have a 'database' property which takes the full host:port/path (or host/port:path) instead of the databaseName specified in the JDBC spec (to be used in conjunction with serverName and portNumber). The new ConnectionPoolDataSource and XADataSource implementations do not include this database property in favour of the standards defined databaseName, serverName and portNumber.

Commits: 7959ef7

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

assignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ]

Fix Version: Jaybird 2.2 [ 10053 ]

@firebird-automations
Copy link
Author

Commented by: Roman Rokytskyy (rrokytskyy)

The reason for this interface was not to expose it to the public, but to guarantee that all parts of driver handle the same set of properties - when a property is added to the interface, all classes that implement this interface, won't compile. So, I think it makes sense to keep the interface in place for exactly this purpose.

As to the "need not be exposed to the client", I guess they mean that in the documentation we should not tell that "if you cast datasource to that interface, you will have access to this and that" and not that no getter/setter should be implemented - how would the connection pools set the properties then?

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

I guess the main reason for that comment in the spec is that they consider configuration DataSource to be purely a concern for application server, and the user of a datasource should not access the properties.

In any case, I probably should not have included that comment in this ticket: my intention is to implement those properties for the new datasources as well, if only to meet expectations of current users.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Added all properties to the new datasources

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants