This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Which is considered to be a better practice ? In a DataAccessLayer : To have a single LightSpeedContext<UnitOfWork> ? or to instantiate the LightSpeedContext<UnitOfWork> in each operation ? |
|
|
Single LightSpeedContext. There's no benefit to creating multiple instances, because they're all going to contain the same info, and you'll usually be treating them as immutable. And there's a slight downside to creating multiple instances if you're using block-based identity methods such as KeyTable -- ID blocks are per-context, so if you use multiple contexts you'll make more trips to the database and you'll chew through your ID range faster. |
|