Project

General

Profile

Actions

Feature #1354

closed

Add session() method to dbo::Transaction for convenience

Added by Jake Petroules over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Michael Vilsker
Target version:
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

Actions #1

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
Actions #2

Updated by Koen Deforche about 12 years ago

  • Status changed from InProgress to Resolved
Actions #3

Updated by Koen Deforche about 12 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF