That's interesting. So, if I'm trying to move instances between threads, is it recommended that I pass between threads the instance id, and then in the receiving thread use session.query(Person).get(instance_id), or... should I pass the instance itself (not by ID), and then use session.merge(instance)?
My objective is that I would want to have full access to access and modify the instance in the session of the receiving thread. Thank you, Michael On Tue, Feb 16, 2016 at 11:26 AM, Mike Bayer <clas...@zzzcomputing.com> wrote: > answered > > > > On 02/16/2016 09:08 AM, Michael Naber wrote: > >> I would like to write code which can correctly merge objects of type X >> or any subclass of type X into the session. I have been doing >> session.merge(X(id=??)), which works fine for merging type X, but if the >> object ID references an instance of any subclass of X, the merge results >> in the discriminator being set incorrectly. Code example here: >> http://stackoverflow.com/questions/35414057 >> >> Any help much appreciated. >> >> Regards, >> Michael >> >> -- >> You received this message because you are subscribed to the Google >> Groups "sqlalchemy" group. >> To unsubscribe from this group and stop receiving emails from it, send >> an email to sqlalchemy+unsubscr...@googlegroups.com >> <mailto:sqlalchemy+unsubscr...@googlegroups.com>. >> To post to this group, send email to sqlalchemy@googlegroups.com >> <mailto:sqlalchemy@googlegroups.com>. >> Visit this group at https://groups.google.com/group/sqlalchemy. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.