示例#1
0
 def copydata(self,rowCount=-1 ):
  try:

   self.m_sourceSession.transaction().start()
   self.m_destSession.transaction().start()

   listsourceTable=listschema( self.m_sourceSession.nominalSchema() )
   listdestTable=listobjects( self.m_destSession.nominalSchema() )
   self._checktable(listsourceTable,listdestTable)

   selectionclause=""
   selectionparameters=coral.AttributeList()
   for key,value in listsourceTable.items():
    iTable = key
    print iTable
    currentCount = 0
    self._copytablelayout(iTable)
    self._copydatalayout(iTable,selectionclause,selectionparameters,currentCount,rowCount)

   self.m_destSession.transaction().commit()
   self.m_sourceSession.transaction().commit()
   print "copydata SUCCESS"
   return True

  except Exception, e:
   self.m_destSession.transaction().rollback()
   self.m_sourceSession.transaction().commit()
   raise Exception ("Error in copydata method: " + str(e))
   return False
示例#2
0
    def copydata(self, rowCount=-1):
        try:

            self.m_sourceSession.transaction().start()
            self.m_destSession.transaction().start()

            listsourceTable = listschema(self.m_sourceSession.nominalSchema())
            listdestTable = listobjects(self.m_destSession.nominalSchema())
            self._checktable(listsourceTable, listdestTable)

            selectionclause = ""
            selectionparameters = coral.AttributeList()
            for key, value in listsourceTable.items():
                iTable = key
                print iTable
                currentCount = 0
                self._copytablelayout(iTable)
                self._copydatalayout(iTable, selectionclause,
                                     selectionparameters, currentCount,
                                     rowCount)

            self.m_destSession.transaction().commit()
            self.m_sourceSession.transaction().commit()
            print "copydata SUCCESS"
            return True

        except Exception, e:
            self.m_destSession.transaction().rollback()
            self.m_sourceSession.transaction().commit()
            raise Exception("Error in copydata method: " + str(e))
            return False
示例#3
0
 def copyschema(self ):
  try:

   listsourceTable=listschema( self.m_sourceSession.nominalSchema() )
   listdestTable=listobjects( self.m_destSession.nominalSchema() )
   self._checktable(listsourceTable,listdestTable)

   for key,value in listsourceTable.items():
    iTable = key
    print iTable
    self._copytablelayout(iTable)

   self.m_destSession.transaction().commit()
   self.m_sourceSession.transaction().commit()
   print "copyschema SUCCESS"

   return True

  except Exception, e:
   self.m_destSession.transaction().rollback()
   self.m_sourceSession.transaction().commit()
   raise Exception ("Error in copyschema method: " + str(e))
   return False
示例#4
0
    def copyschema(self):
        try:

            listsourceTable = listschema(self.m_sourceSession.nominalSchema())
            listdestTable = listobjects(self.m_destSession.nominalSchema())
            self._checktable(listsourceTable, listdestTable)

            for key, value in listsourceTable.items():
                iTable = key
                print iTable
                self._copytablelayout(iTable)

            self.m_destSession.transaction().commit()
            self.m_sourceSession.transaction().commit()
            print "copyschema SUCCESS"

            return True

        except Exception, e:
            self.m_destSession.transaction().rollback()
            self.m_sourceSession.transaction().commit()
            raise Exception("Error in copyschema method: " + str(e))
            return False