1

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 donePayment call setGoalPayment of another module and its again should pass DBsession object to that. is there any way to use something like singleton in java here? something that stays upper level of modules and each module could access it.

  • Why are you tying the database to your domain model? – Kain0_0 Nov 14 '18 at 4:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.