Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Pooling Morphia Datasource

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mongoDB'ians,

I understand from the mongoDB documentation on the Java Driver is that, the Mongo object is a connection pool in itself. But what about the Datasource object to which I pass the Mongo and Morphia instances as constructor parameters? The Datasource object here is analogous to the JPA EntityManager and in my previous experience working with JPA, I've never connection pooled an EntityManager. So my question is can I instantiate the Datasource as and when I like and leave it t be garbage collected when the Datasource object goes out of scope? or do I have to connection pool it?

Unfortunately, I haven't seen any relevant documentation on this from the Morphia website.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic