I have a project which has a service-oriented architecture. for example, anything relates to
payment is inside payment module.
-dao -config -constatnts -middlewares -modules -payment -user -bankTransaction -... -routes
and expect of mongoose models, all codes are inside the module.
now I want to use mongoDb
session for running the query in
Transaction mode. so I want to
bankTransaction service starts a mongoose
session and call a
donePayment method from
payment modules and should pass
DBsession to this function. and
setGoalPayment of another module and its again should pass
DBsession object to that.
is there any way to use something like singleton in
something that stays upper level of modules and each module could access it.