Ocean/CustomerDB/AccessDB.go
Thorsten Sommer 7120a729bd Bug fixing
+ DB access is now right and uses copied sessions
+ DB session is now specifying the safe state and the mode
+ Fixed the issue with too early ICCC messages regarding to late cache
+ Add the MIME type for Dart
+ Fixed the issuse with wrong order of shutdown handlers
- TODO: Testing of these changes
2014-06-04 21:41:18 +02:00

27 lines
610 B
Go

package CustomerDB
import "labix.org/v2/mgo"
/*
Get the database instance of the MGo Mongo driver.
*/
func DB() (session *mgo.Session, database *mgo.Database) {
session = mainSession.Copy()
database = session.DB(databaseDB)
database.Login(databaseUsername, databasePassword)
return
}
/*
Get directly the GridFS instance of the Mgo Mongo driver.
*/
func GridFS() (session *mgo.Session, filesystem *mgo.GridFS) {
session = mainSession.Copy()
database := session.DB(databaseDB)
database.Login(databaseUsername, databasePassword)
filesystem = database.GridFS(`fs`)
return
}