What is the purpose of Managers / Transactions?
Posted
by maxdj
on Stack Overflow
See other posts from Stack Overflow
or by maxdj
Published on 2010-06-10T00:17:31Z
Indexed on
2010/06/10
0:22 UTC
Read the original article
Hit count: 385
I'm building a spring application for the first time. I'm running into lots of problems with concurrency, and I suspect that there is something wrong with the way I'm managing the backend. The only difference I can see between my backend code and examples I've seen are manager classes.
In my code, I have my model (managed by hibernate) and my DAOs on top of that to do CRUD/searching/etc on the models. In example code I have looked at, they never use the DAO directly. Instead, they use manager classes that call the DAOs indirectly. To me, this just seems like pointless code duplication.
What are these manager classes for? I've read that they wrap my code in "transactions," but why would I want that?
© Stack Overflow or respective owner