Thank you guys for the answers...
first of all
@high_flyer - I am stuck with the one class I have which is to control other classes when transaction mode is on... for example I have an object to place in the table A, and than I need lastInsertedId of it to insert some objects to table B... this needs to be done in transaction because the failure anywhere must affect on rolling back everything.
class TransactionHandler
: public QObject{ Q_OBJECT
Q_CLASSINFO("version","0.2")
public:
TransactionHandler
(QObject *parent
= 0);
virtual ~TransactionHandler();
void addQuery(QueryHandler *query);
bool perform() const;
bool status() const;
private:
bool isTranDone;
QExplicitlySharedDataPointer<QueryHandlerData> d};
class TransactionHandler : public QObject{
Q_OBJECT
Q_CLASSINFO("version","0.2")
public:
TransactionHandler(QObject *parent = 0);
virtual ~TransactionHandler();
void addQuery(QueryHandler *query);
bool perform() const;
bool status() const;
private:
bool isTranDone;
QExplicitlySharedDataPointer<QueryHandlerData> d};
To copy to clipboard, switch view to plain text mode
this is the body of my class which I am trying to implement
One Sentence - inability to come up with something common for all classes which must be controlled if necessary by TransactionHandler
@marcvanriet - this is exactly what I am trying to achieve now by TransactionHandler, because if I need transaction I create an object of TransactionHandler, aggregate all other XQuery objects and simply call for perform() method which does the job, or rather should. Having all the transaction-controlling code in the gui-code is something I don't want to have, and I am trying to separate it. I would like to have anykind of automatic way, any kind of starting point to gather something common... anyway I am still looking
Bookmarks