Hello all,

I have a problem using session.merge() in version 0.3.10. I'm trying to merge an
object I'm getting via SOAP from a different server. Here is my code:


self._censusTable = Table('census', self._dbMetaData, autoload=True)
self._censusMapper = mapper(Census, self._censusTable)
self._session = create_session()


def writeCensus(self, soapCensus):
        currentTrans = self._session.create_transaction()
        try:
                sessionCensus = \
                self._session.query(Census).get(soapCensus.id)
                test = self._session.merge(soapCensus)
                currentTrans.commit()
                        
        except Exception, e:
                currentTrans.rollback()


The result is:

FlushError: New instance [EMAIL PROTECTED] with identity key (<class
'census.Census'>, (12347,), None) conflicts with persistent instance
[EMAIL PROTECTED]

soapCensus is an instance of class Census created by the SOAP library (ZSI),
which should be the same as restoring an object via pickle.
Am I doing something wrong? Do I have to use 0.4 for this to work?
Help would be appreciated.

Thanks,
Kevin







--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to