[Libpqxx-general] Liskov Substitution and Transactions

Maurice Gittens mainmanmauricio at gmail.com
Mon Apr 27 06:54:13 UTC 2009


Oops, I hit send at the wrong moment.

Here is another try.

On Mon, Apr 27, 2009 at 8:49 AM, Maurice Gittens
<mainmanmauricio at gmail.com>wrote:

> Jeroen,
>
>
>
> On Mon, Apr 27, 2009 at 6:45 AM, Jeroen Vermeulen <jtv at xs4all.nl> wrote:
>
>> Maurice Gittens wrote:
>>
>>  When substituting a pqxx::subtransation* for a pqxx::basic_transaction* I
>>> need to cast them to pqxx::basic_transactions*.
>>> This is probably due to the fact that the subtransaction class has two
>>> base
>>> classes.
>>> This would seem to violate the premise that a pqxx::subtransaction ISA
>>> pqxx::basic_transaction.
>>>
>>
>> Ahem.  I stupidly gave you the wrong class.  That should have been
>> transaction_base!
>>
>

Assuming:
   typedef std::vector<pqxx::transaction_base*> TransactionStack;
   TransactionStack theTxStack;

The statement:
    // theTxStack is not empty
    theTxStack.push_back(new pqxx::subtransaction(*theTxStack.back(),
std::string("")));

still barfs. It seems a subtransaction takes a dbtransaction as a
constructor argument.

Tips?

Kind regards,
Maurice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/libpqxx-general/attachments/20090427/00c62cc3/attachment.html 


More information about the Libpqxx-general mailing list