How to implement the getDataStore method as singleton method(threadsafe) in a Scala object or Scala's object will implement this method automatically as a singleton method?
object MorphiaHelper {
  var morphia = new Morphia()
  var datastore = null
  def getDataStore() = {morphia.createDatastore(new Mongo(mongoip, mongoport), "test")
  }
}
 
     
    