Connecting to Mongo from an Apache Wink / JAX-RS Application

84 views Asked by At

I'm writing my first Apache Wink / JAX-RS web service, and I want to connect to MongoDB. Is the best way to do this to create a new connection each time a request is received and close it at the end of the request, or is there some way to have a persistent connection that I can access from my service?

The latter seems a much more sensible approach to me, but some Googling has failed to turn up much information on the subject and how I could achieve that.

Any pointers in the right direction would be appreciated!

0

There are 0 answers