Esempio n. 1
0
 public static void initAttrManager()
 {
     Hashtable <String, DBAdapter> .Enumerator hashEnum = m_mapDBPartitions.GetEnumerator();
     while (hashEnum.MoveNext())
     {
         DBAdapter db = hashEnum.Current.Value;
         db.getAttrMgr().loadBlobAttrs(db);
         if (!db.getAttrMgr().hasBlobAttrs())
         {
             db.m_dbStorage.setDbCallback(null);
         }
     }
 }
Esempio n. 2
0
            private void processDelete(String tableName, IDBResult rows2Delete, int[] cols)
            {
                if (tableName.equalsIgnoreCase("changed_values") || tableName.equalsIgnoreCase("sources") ||
                    tableName.equalsIgnoreCase("client_info"))
                {
                    return;
                }

                boolean bProcessTable = tableName.equalsIgnoreCase("object_values");
                boolean bSchemaSrc    = false;
                int     nSrcID        = 0;

                if (!bProcessTable)
                {
                    nSrcID        = m_db.getAttrMgr().getSrcIDHasBlobsByName(tableName);
                    bProcessTable = nSrcID != 0;
                    bSchemaSrc    = bProcessTable;
                }

                if (!bProcessTable)
                {
                    return;
                }

                if (!bSchemaSrc && !isChangedCol(cols, 3))         //value
                {
                    return;
                }

                for ( ; !rows2Delete.isEnd(); rows2Delete.next())
                {
                    if (!bSchemaSrc)
                    {
                        nSrcID = rows2Delete.getIntByIdx(0);

                        String attrib = rows2Delete.getStringByIdx(1);
                        String value  = rows2Delete.getStringByIdx(3);

                        //if (cols == null) //delete
                        //	m_db.getAttrMgr().remove(nSrcID, attrib);

                        if (m_db.getAttrMgr().isBlobAttr(nSrcID, attrib))
                        {
                            processBlobDelete(nSrcID, attrib, value);
                        }
                    }
                    else
                    {
                        Object[] data = rows2Delete.getCurData();
                        for (int i = 0; i < rows2Delete.getColCount(); i++)
                        {
                            if (!isChangedCol(cols, i))
                            {
                                continue;
                            }

                            String attrib = rows2Delete.getColName(i);
                            if (!(data[i] is String))
                            {
                                continue;
                            }

                            String value = (String)data[i];
                            if (m_db.getAttrMgr().isBlobAttr(nSrcID, attrib))
                            {
                                processBlobDelete(nSrcID, attrib, value);
                            }
                        }
                    }
                }
            }