[Libpqxx-general] Liskov Substitution and Transactions

Maurice Gittens mainmanmauricio at gmail.com
Mon Apr 27 06:49:43 UTC 2009


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;
theTxStack

        theTxStack.push_back(new pqxx::subtransaction(*theTxStack.back(),
std::string("")));




>
>
>
>  PS: http://www.pqxx.org/development/libpqxx/ seems to be down.
>>
>
> Whoops, indeed.  Fixed now.  Thanks for the warning.
>
>
> Jeroen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pgfoundry.org/pipermail/libpqxx-general/attachments/20090427/a83fed66/attachment.html 


More information about the Libpqxx-general mailing list