2

I am developing a Jee7 project and would like to employ mongoDB as the backend database.

My jee7 application will run on Glassfish 4.

I wish to use the Glassfish 4 admin console to configure my mongoDB jdbc connection pool etc..

However Glassfish 4 doesn't list mongoDB in its list of supported Database Driver Vendor

Does this mean that you do not configure mongoDB in the same way as say DB2 or MySQL?

I could configure mongoDB using a EJB singleton, but that doesn't feel correct.

Hector
  • 4,016
  • 21
  • 112
  • 211

1 Answers1

1

I don't think you can without writing your own resource adapter. First, mongodb is non-transactionable, so it's not like it needs to participate in any transaction related events. Second, their java driver manages the connection with their own internal connection pool.

Although it would be nice to configure the resource outside of the app, in reality you should just create a singleton bean and do everything from there.

Also take a look at producers.

Community
  • 1
  • 1
John Manko
  • 1,828
  • 27
  • 51