jboss / jboss-nosql

3 stars 0 forks source link

Naked @Inject MongoDatabase database should use default MongoDB profile if there is one... #7

Open scottmarlow opened 8 years ago

scottmarlow commented 8 years ago

If there is only one MongoDB profile defined, that can be used as the default MongoDB database. If there are multiple MongoDB profiles defined, a naked @Inject should be fail deployment. I'm not sure if "naked" is the right term to use.

scottmarlow commented 8 years ago

Most likely, to support this, we need to scan applications for use of @Inject and see if they use @Named qualifier. We are already scanning for use of @Named currently, to get the NoSQL profile name (so we can add the configured NoSQL driver module dependency to the application deployment).

scottmarlow commented 8 years ago

Pushed a wip change to https://github.com/scottmarlow/wildfly/tree/nosql-dev9-injectNoNamingSpecified. Not sure that this change is worthwhile, as we would need to scan for @Inject instead of @Named, which requires more filtering of the non-NoSql cases.

The other concern is that users could get confused/mad when some app deployments fail to work, as soon as a second NoSQL connection profile is defined.