On Sat, February 10, 2007 06:36, Curran Schiefelbein wrote: > I've ventured into transactors and largeobjects, and some behavior's > puzzling me. Hope it's not too much trouble to ask for an explanation, > since I'm probably just doing something backwards...
I think you're running into one of the finer points of transactors. See this page in the tutorial: http://thaiopensource.org/devprojects/libpqxx/doc/2.6.8/html/Tutorial/ch03s07.html#transactor-working Your transactor object is copied, and it is the *copy* that actually runs. If you want to store data somewhere permanent once your transaction has succeeded, overload the on_commit() member function. This will be invoked upon completion, on the copy that succeeded. Perhaps we should change connection_base::perform() so that, upon successful completion of a transactor, it assigns the "completed" transactor object back to the original that was passed in as an argument? > I know the pointer is good at the end of on_commit(), but it's been > overwritten when the caller makes the very next call, to getResult(). > Not sure why, as my transactor instance is still in scope. Segfault > follows. It wasn't overwritten, it was just never written *in that object* in the first place! Jeroen _______________________________________________ Libpqxx-general mailing list [email protected] http://gborg.postgresql.org/mailman/listinfo/libpqxx-general
