dfki-asr / compass

Collaborative Modular Prototyping And Simulation Server
Apache License 2.0
2 stars 0 forks source link

Feature/entitymanager scope #30

Closed wherget closed 9 years ago

wherget commented 9 years ago

CRUDService is no longer a Singleton (avoiding concurrency issues). @Stateless beans however, default to RequestScoped, which is too short a lifetime for the EntityManager. Since the EM is held in the Producer (and no longer implicitly in the CRUDService), we prolong the lifetime of the Producer to ConversationScoped. (And explicitly extend that to what amounts to SessionScoped for JSF.)

So much functional for so little code change. I'm impressed and scared at the same time.