Actions
Feature #1354
closedAdd session() method to dbo::Transaction for convenience
Start date:
07/10/2012
Due date:
% Done:
0%
Estimated time:
Description
For convenience I think the dbo::Transaction class should provide a session() method that returns a reference to its associated session. This just allows for more concise code. Consider the following case:
Session &s = wApp->mySessionAccessor();
dbo::Transaction t(s);
UNUSED_MACRO(t);
dbo::collection<ProductPtr> products = s.find<Product>().limit(10);
This code can be shortened and made more readable with the addition of the proposed property:
dbo::Transaction t(wApp->mySessionAccessor());
dbo::collection<ProductPtr> products = t.session().find<Product>().limit(10);
I've attached a patch file that adds this method.
Files
Updated by Koen Deforche about 12 years ago
- Status changed from New to InProgress
- Assignee set to Michael Vilsker
- Target version set to 3.2.3
Updated by Koen Deforche about 12 years ago
- Status changed from InProgress to Resolved
Updated by Koen Deforche about 12 years ago
- Status changed from Resolved to Closed
Actions