Hello, I'm working on a project with a premade solution containing different projects representing layers :
Business entities, data layer, business logic layer and presentation layer ( at least it's how I understand them ). We have also some class which supposely help us to use nhibernate easily ...
One recommendation made was to use transactions in the business logic layer ( because the data layer wouldn't know if we were in a transaction context or not ), the other was to get the current session and close it in the data layer. Also we use one method / query ( well sometimes it's not exactly like this ) in the data layer.
Is that the right "way" to use nhibernate? Doing any kind of transaction like this is a bit painful ( often some errors, so we have to find workaround...)
I've the feeling that we don't use nhibernate like it should, but I don't have really any experience with mapping o/r tools or plainly "architecture design"/real po knowledge.
In the FAQ, the exemple is "getting session, starting transaction, works, closing transaction, closing session" but should it be in the data or business logic layer? Is this exemple accurate for a 3-tier architecture?
|