[Internal: merge oma-dm-agent]
[framework/system/oma-dm-agent.git] / src / agent / common / dm-status / oma_dm_status_db_handler.c
1 /*
2  * oma-dm-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 /*sync-agent*/
19 #include <sync_agent.h>
20
21 /*dm-agent*/
22 #include "common/dm-status/oma_dm_status_db_handler.h"
23 #include "common/dm-status/oma_dm_status_db.h"
24
25 #ifndef OMADM_AGENT_LOG
26 #undef LOG_TAG
27 #define LOG_TAG "OMA_DM_DB"
28 #endif
29
30 static db_handler_mgr *pDBHandlerMgr = 0;
31
32 /* static function define */
33 static DM_ERROR _add_agent_handler(unsigned int key, DB_HANDLER * pHandler);
34 static DM_ERROR _remove_agent_handler(unsigned int key);
35 static DB_HANDLER *_get_agent_handler(unsigned int key);
36 static DM_ERROR __alloc_agent_dc_handlerTable();
37 static DM_ERROR __alloc_agent_dc_handlerTable_mutex();
38 static DM_ERROR _free_agent_dc_handlerTable();
39 static DM_ERROR _free_agent_dc_handlerTable_mutex();
40 static DM_ERROR _create_agentDBHandlerMgrInfo();
41 static void ___destroy_agentDBHashTableValue(void *pHandler);
42 static void ___destory_agentDBHashTableKey(void *key);
43
44 /* test function define*/
45 /*static void                                   __print_agentDBHashTableLog();*/
46
47 /* general function implementation */
48 /*
49  * ==================================
50  * external API (1. about db handler mgr)
51  * ==================================
52  */
53 DM_ERROR Alloc_DB_Handler_Mgr()
54 {
55         _EXTERN_FUNC_ENTER;
56
57         DM_ERROR ret = DM_OK;
58
59         /* alloc the agentDBHandlerMgr */
60         pDBHandlerMgr = (db_handler_mgr *) calloc(1, sizeof(db_handler_mgr));
61         if (pDBHandlerMgr == NULL) {
62                 _DEBUG_INFO("alloc fail");
63                 _EXTERN_FUNC_EXIT;
64                 return COMMON_ERR_ALLOC;
65         }
66         _DEBUG_INFO("[%s] pMoDBHandlerMgr alloc success !\n", __func__);
67
68         /* alloc the agentDBHandlerMgr information */
69         ret = _create_agentDBHandlerMgrInfo();
70         if (ret != DM_OK)
71                 _DEBUG_INFO("[%s] __create_agentDBHandlerMgrInfo alloc fail !\n", __func__);
72         else
73                 _DEBUG_INFO("[%s] __create_agentDBHandlerMgrInfo alloc success !\n", __func__);
74
75         _EXTERN_FUNC_EXIT;
76         return ret;
77 }
78
79 DM_ERROR Free_DB_Handler_Mgr()
80 {
81         _EXTERN_FUNC_ENTER;
82         DM_ERROR ret = DM_OK;
83
84         if (pDBHandlerMgr != NULL) {
85
86                 ret = _free_agent_dc_handlerTable_mutex();
87                 if (ret != DM_OK) {
88                         _EXTERN_FUNC_EXIT;
89                         return DM_ERR_UNKNOWN;
90                 }
91
92                 ret = _free_agent_dc_handlerTable();
93                 if (ret != DM_OK) {
94                         _EXTERN_FUNC_EXIT;
95                         return DM_ERR_UNKNOWN;
96                 }
97         }
98
99         _EXTERN_FUNC_EXIT;
100         return ret;
101 }
102
103 void Free_Memory_Engine_Status(engine_status ** status, int count)
104 {
105         _EXTERN_FUNC_ENTER;
106         engine_status *temp_status = *status;
107
108         int i;
109         for (i = 0; i < count; i++) {
110                 MEMORY_FREE(temp_status[i].server_id);
111                 MEMORY_FREE(temp_status[i].server_url);
112                 MEMORY_FREE(temp_status[i].correlator);
113                 MEMORY_FREE(temp_status[i].ui_mode);
114                 MEMORY_FREE(temp_status[i].mo_path);
115         }
116
117         MEMORY_FREE(temp_status);
118         *status = 0;
119         _EXTERN_FUNC_EXIT;
120 }
121
122 /*
123  * ==================================
124  * external API (2. about agent db )
125  * ==================================
126  */
127 DM_ERROR DB_Open()
128 {
129         _EXTERN_FUNC_ENTER;
130         int ret = 0;
131
132         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
133         if (db_handler == NULL) {
134
135                 _DEBUG_INFO("db_handler is 0");
136                 _DEBUG_INFO("should register db_handler to db_handler_hash_table");
137                 ret = dm_open_agent(&db_handler);
138                 if (ret != DM_OK) {
139                         _EXTERN_FUNC_EXIT;
140                         return ret;
141                 }
142
143                 if (db_handler != NULL) {
144                         /* add agentDB handler to agentDBHandleMgr */
145                         ret = _add_agent_handler(GET_THREAD_ID, db_handler);
146                         if (ret != DM_OK) {
147                                 _EXTERN_FUNC_EXIT;
148                                 return ret;
149                         }
150                 }
151         } else {
152                 _DEBUG_INFO("db_handler is not null");
153                 _DEBUG_INFO("should not register db_handler to db_handler_hash_table");
154         }
155
156         _DEBUG_INFO("agent_db_agent_open_success");
157         _EXTERN_FUNC_EXIT;
158         return DM_OK;
159 }
160
161 void DB_Close()
162 {
163         _EXTERN_FUNC_ENTER;
164
165         DM_ERROR ret = DM_OK;
166
167         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
168         if (db_handler != NULL) {
169
170                 /* remove agentDB handler to agentDBHandleMgr */
171                 ret = _remove_agent_handler(GET_THREAD_ID);
172                 if (ret != DM_OK) {
173                         _DEBUG_INFO("agent_db_agent_close_fail");
174                         _EXTERN_FUNC_EXIT;
175                         return;
176                 }
177                 _DEBUG_INFO("agent_db_agent_close_success");
178         }
179         _EXTERN_FUNC_EXIT;
180 }
181
182 DM_ERROR DB_Create_Table()
183 {
184         _EXTERN_FUNC_ENTER;
185
186         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
187         if (db_handler == NULL) {
188                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
189                 _EXTERN_FUNC_EXIT;
190                 return DM_ERR_UNKNOWN;
191         }
192         _EXTERN_FUNC_EXIT;
193         return dm_create_table(db_handler);
194 }
195
196 DM_ERROR DB_Delete_Table()
197 {
198         _EXTERN_FUNC_ENTER;
199
200         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
201         if (db_handler == NULL) {
202                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
203                 _EXTERN_FUNC_EXIT;
204                 return DM_ERR_UNKNOWN;
205         }
206         _EXTERN_FUNC_EXIT;
207         return dm_delete_table(db_handler);
208 }
209
210 DM_ERROR DB_Reset_Table()
211 {
212         _EXTERN_FUNC_ENTER;
213
214         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
215         if (db_handler == NULL) {
216                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
217                 _EXTERN_FUNC_EXIT;
218                 return DM_ERR_UNKNOWN;
219         }
220         _EXTERN_FUNC_EXIT;
221         return dm_reset_table(db_handler);
222 }
223
224 DM_ERROR DB_Begin_Transaction()
225 {
226         _EXTERN_FUNC_ENTER;
227
228         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
229         if (db_handler == NULL) {
230                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
231                 _EXTERN_FUNC_EXIT;
232                 return DM_ERR_UNKNOWN;
233         }
234         _EXTERN_FUNC_EXIT;
235         return dm_begin_transaction(db_handler);
236 }
237
238 DM_ERROR DB_End_Transaction(DB_TRANSACTION transaction)
239 {
240         _EXTERN_FUNC_ENTER;
241
242         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
243         if (db_handler == NULL) {
244                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
245                 _EXTERN_FUNC_EXIT;
246                 return DM_ERR_UNKNOWN;
247         }
248         _EXTERN_FUNC_EXIT;
249         return dm_end_transaction(db_handler, transaction);
250 }
251
252 DM_ERROR Init_Engine_Status()
253 {
254         _EXTERN_FUNC_ENTER;
255
256         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
257         if (db_handler == NULL) {
258                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
259                 _EXTERN_FUNC_EXIT;
260                 return DM_ERR_UNKNOWN;
261         }
262         _EXTERN_FUNC_EXIT;
263         return dm_init_engine_status(db_handler);
264 }
265
266 DM_ERROR Add_Engine_Status(engine_status * status)
267 {
268         _EXTERN_FUNC_ENTER;
269
270         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
271         if (db_handler == NULL) {
272                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
273                 _EXTERN_FUNC_EXIT;
274                 return DM_ERR_UNKNOWN;
275         }
276         _EXTERN_FUNC_EXIT;
277         return dm_add_engine_status(db_handler, status);
278 }
279
280 DM_ERROR Delete_Engine_Status(int engine_id)
281 {
282         _EXTERN_FUNC_ENTER;
283
284         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
285         if (db_handler == NULL) {
286                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
287                 _EXTERN_FUNC_EXIT;
288                 return DM_ERR_UNKNOWN;
289         }
290
291         _EXTERN_FUNC_EXIT;
292         return dm_delete_engine_status(db_handler, engine_id);
293 }
294
295 DM_ERROR Update_Engine_Status(engine_status * status)
296 {
297         _EXTERN_FUNC_ENTER;
298
299         retvm_if(status == NULL, DM_ERR_UNKNOWN, "engine status is NULL !!");
300         _DEBUG_INFO("status [%d]", status);
301
302         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
303         if (db_handler == NULL) {
304                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
305                 _EXTERN_FUNC_EXIT;
306                 return DM_ERR_UNKNOWN;
307         }
308
309         int ret = dm_isExist_engine_id(db_handler, status->engine_id);
310         if (ret == 0) {
311                 _EXTERN_FUNC_EXIT;
312                 return dm_add_engine_status(db_handler, status);
313         } else {
314                 _DEBUG_INFO("status->engine_id [%d]", status->engine_id);
315                 _DEBUG_INFO("status->download_click [%d]", status->download_click);
316                 _EXTERN_FUNC_EXIT;
317                 return dm_update_engine_status(db_handler, status);
318         }
319 }
320
321 DM_ERROR Update_Engine_Status_Column(int engine_id, ENGINE_STATUS_VALUE engine_status_value, void *value)
322 {
323         _EXTERN_FUNC_ENTER;
324
325         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
326         if (db_handler == NULL) {
327                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
328                 _EXTERN_FUNC_EXIT;
329                 return DM_ERR_UNKNOWN;
330         }
331         _EXTERN_FUNC_EXIT;
332         return dm_update_engine_status_column(db_handler, engine_id, engine_status_value, value);
333 }
334
335 DM_ERROR Get_Engine_Status(int engine_id, engine_status ** status)
336 {
337         _EXTERN_FUNC_ENTER;
338
339         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
340         if (db_handler == NULL) {
341                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
342                 _EXTERN_FUNC_EXIT;
343                 return DM_ERR_UNKNOWN;
344         }
345         _EXTERN_FUNC_EXIT;
346         return dm_get_engine_status(db_handler, engine_id, status);
347 }
348
349 DM_ERROR Get_AII_Engine_Status(engine_status ** status_list, int *count)
350 {
351         _EXTERN_FUNC_ENTER;
352
353         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
354         if (db_handler == NULL) {
355                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
356                 _EXTERN_FUNC_EXIT;
357                 return DM_ERR_UNKNOWN;
358         }
359
360         _EXTERN_FUNC_EXIT;
361         return dm_get_aII_engine_status(db_handler, status_list, count);
362 }
363
364 int IsExist_Engine_id(int engine_id)
365 {
366         _EXTERN_FUNC_ENTER;
367
368         DB_HANDLER *db_handler = _get_agent_handler(GET_THREAD_ID);
369         if (db_handler == NULL) {
370                 _DEBUG_INFO("[%s] no handler for key\n", __func__);
371                 _EXTERN_FUNC_EXIT;
372                 return DM_ERR_UNKNOWN;
373         }
374
375         _EXTERN_FUNC_EXIT;
376
377         return dm_isExist_engine_id(db_handler, engine_id);
378 }
379
380 /*
381  * ==================================
382  *  DB module internal API
383  * ==================================
384  */
385 DM_ERROR _add_agent_handler(unsigned int key, DB_HANDLER * pHandler)
386 {
387         _INNER_FUNC_ENTER;
388
389         if (pDBHandlerMgr == NULL || pDBHandlerMgr->db_handlerTable_mutex == NULL) {
390                 return DM_ERR_UNKNOWN;
391         }
392
393         DM_ERROR ret = DM_OK;
394
395         unsigned int *pKey_copy = (unsigned int *)calloc(1, sizeof(unsigned int));
396         if (pKey_copy == NULL) {
397                 _INNER_FUNC_EXIT;
398                 return COMMON_ERR_ALLOC;
399         }
400
401         *pKey_copy = key;
402
403         pthread_mutex_lock(pDBHandlerMgr->db_handlerTable_mutex);
404         if (pDBHandlerMgr->db_handlerTable == NULL) {
405                 ret = __alloc_agent_dc_handlerTable();
406                 if (ret != DM_OK)
407                         goto addagentHandler;
408         }
409
410         /* insert to handler */
411         _DEBUG_TRACE("[%s] Key  =  %d, Handler  =  %p  !\n", __func__, key, pHandler);
412         g_hash_table_insert(pDBHandlerMgr->db_handlerTable, pKey_copy, pHandler);
413
414 #ifdef DC_PRINT
415         /* For test log */
416         __print_agentDBHashTableLog();
417 #endif
418         pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex);
419         if(pKey_copy != NULL) {
420                 free(pKey_copy);
421         }
422         _INNER_FUNC_EXIT;
423         return ret;
424
425  addagentHandler:
426         pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex);
427         if(pKey_copy != NULL) {
428                 free(pKey_copy);
429         }
430         _INNER_FUNC_EXIT;
431         return ret;
432 }
433
434 DM_ERROR _remove_agent_handler(unsigned int key)
435 {
436         _INNER_FUNC_ENTER;
437
438         if (pDBHandlerMgr == NULL || pDBHandlerMgr->db_handlerTable_mutex == NULL || pDBHandlerMgr->db_handlerTable == NULL) {
439                 _INNER_FUNC_EXIT;
440                 return DM_ERR_UNKNOWN;
441         }
442
443         /* remove the handler to hash table */
444         pthread_mutex_lock(pDBHandlerMgr->db_handlerTable_mutex);
445         int isSuccess = g_hash_table_remove(pDBHandlerMgr->db_handlerTable, &key);
446         pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex);
447
448 #ifdef DC_PRINT
449         /* for test log */
450         __print_agentDBHashTableLog();
451 #endif
452
453         _DEBUG_TRACE("[%s] end !\n", __func__);
454         if (isSuccess == 1) {
455                 _EXTERN_FUNC_EXIT;
456                 return DM_OK;
457         }
458
459         _INNER_FUNC_EXIT;
460
461         return DM_ERR_UNKNOWN;
462 }
463
464 DB_HANDLER *_get_agent_handler(unsigned int key)
465 {
466         _INNER_FUNC_ENTER;
467
468         if (pDBHandlerMgr == NULL || pDBHandlerMgr->db_handlerTable_mutex == NULL || pDBHandlerMgr->db_handlerTable == NULL) {
469                 _DEBUG_TRACE("[%s] DM_ERR_UNKNOWN !\n", __func__);
470                 _INNER_FUNC_EXIT;
471
472                 return 0;
473         }
474
475         /* get the handler to hash table */
476         pthread_mutex_lock(pDBHandlerMgr->db_handlerTable_mutex);
477         DB_HANDLER *pHandler = g_hash_table_lookup(pDBHandlerMgr->db_handlerTable, &key);
478         pthread_mutex_unlock(pDBHandlerMgr->db_handlerTable_mutex);
479
480 #ifdef DC_PRINT
481         if (pHandler != NULL) {
482                 _DEBUG_TRACE("[%s] ######### > Value Search Success(key = %d, handler = %p)\n", __func__, key, pHandler);
483         } else {
484                 _DEBUG_TRACE("[%s] ######### > Value Search Fail(key = %d, handler = %p)\n", __func__, key, pHandler);
485         }
486 #endif
487         _INNER_FUNC_EXIT;
488
489         return pHandler;
490 }
491
492 /* static function implementation */
493 static DM_ERROR __alloc_agent_dc_handlerTable()
494 {
495         _INNER_FUNC_ENTER;
496
497         if (pDBHandlerMgr != NULL) {
498                 pDBHandlerMgr->db_handlerTable = g_hash_table_new_full(g_int_hash, g_int_equal, ___destory_agentDBHashTableKey, ___destroy_agentDBHashTableValue);
499                 if (pDBHandlerMgr->db_handlerTable == NULL) {
500                         _DEBUG_TRACE("[%s] Not Create agent dc handler hash table \n", __func__);
501                         _INNER_FUNC_EXIT;
502                         return DM_ERR_UNKNOWN;
503                 } else {
504                         _DEBUG_TRACE("[%s] create agent dc handler hash table \n", __func__);
505                 }
506         }
507
508         _INNER_FUNC_EXIT;
509
510         return DM_OK;
511 }
512
513 static DM_ERROR __alloc_agent_dc_handlerTable_mutex()
514 {
515         _INNER_FUNC_ENTER;
516
517         if (pDBHandlerMgr != NULL) {
518
519                 pDBHandlerMgr->db_handlerTable_mutex = (pthread_mutex_t *) calloc(1, sizeof(pthread_mutex_t));
520                 if (pDBHandlerMgr->db_handlerTable_mutex == NULL) {
521                         _DEBUG_TRACE("[%s] Not Create agent dc handler hash table mutex \n", __func__);
522                         _INNER_FUNC_EXIT;
523                         return COMMON_ERR_ALLOC;
524                 } else {
525
526                         if (pthread_mutex_init(pDBHandlerMgr->db_handlerTable_mutex, 0) != 0) {
527                                 _DEBUG_TRACE("[%s] Not init agent dc handler hash table mutex\n", __func__);
528                                 _INNER_FUNC_EXIT;
529                                 return DM_ERR_UNKNOWN;
530                         }
531                         _DEBUG_TRACE("[%s] Init agent dc handler hash table mutex\n", __func__);
532                 }
533         }
534
535         _INNER_FUNC_EXIT;
536
537         return DM_OK;
538 }
539
540 static DM_ERROR _free_agent_dc_handlerTable()
541 {
542         _INNER_FUNC_ENTER;
543
544         if (pDBHandlerMgr != NULL && pDBHandlerMgr->db_handlerTable != NULL) {
545                 g_hash_table_destroy(pDBHandlerMgr->db_handlerTable);
546                 _DEBUG_TRACE("[%s] db_handlerTable free success !\n", __func__);
547                 pDBHandlerMgr->db_handlerTable = 0;;
548         }
549         _INNER_FUNC_EXIT;
550
551         return DM_OK;
552 }
553
554 static DM_ERROR _free_agent_dc_handlerTable_mutex()
555 {
556         _INNER_FUNC_ENTER;
557
558         if (pDBHandlerMgr != NULL && pDBHandlerMgr->db_handlerTable_mutex != NULL) {
559
560                 int ret = pthread_mutex_destroy(pDBHandlerMgr->db_handlerTable_mutex);
561                 if (ret != 0) {
562                         _DEBUG_TRACE("[%s] db_handlerTable_mutex free error !\n", __func__);
563                         return DM_ERR_UNKNOWN;
564                 } else {
565                         free(pDBHandlerMgr->db_handlerTable_mutex);
566                         pDBHandlerMgr->db_handlerTable_mutex = 0;
567                         _DEBUG_TRACE("[%s] db_handlerTable_mutex free success !\n", __func__);
568                 }
569         }
570         _INNER_FUNC_EXIT;
571
572         return DM_OK;
573 }
574
575 static DM_ERROR _create_agentDBHandlerMgrInfo()
576 {
577         _INNER_FUNC_ENTER;
578
579         DM_ERROR ret = DM_OK;
580
581         if (pDBHandlerMgr != NULL) {
582
583                 /* alloc agent db hander hash table */
584                 ret = __alloc_agent_dc_handlerTable();
585                 if (ret != DM_OK)
586                         goto allocAgentDBHandlerMgrInfoErr;
587
588                 /* alloc agent db hander hash table mutex */
589                 ret = __alloc_agent_dc_handlerTable_mutex();
590                 if (ret != DM_OK)
591                         goto allocAgentDBHandlerMgrInfoErr;
592         }
593         _INNER_FUNC_EXIT;
594
595         return DM_OK;
596
597  allocAgentDBHandlerMgrInfoErr:
598         Free_DB_Handler_Mgr();
599
600         _INNER_FUNC_EXIT;
601         return DM_ERR_UNKNOWN;
602 }
603
604 static void ___destroy_agentDBHashTableValue(void *pHandler)
605 {
606         _INNER_FUNC_ENTER;
607
608         _DEBUG_VERBOSE("[%s] start \n", __func__);
609         if ((DB_HANDLER *) pHandler != 0) {
610                 dm_close_agent((DB_HANDLER *) pHandler);
611         }
612
613         _INNER_FUNC_EXIT;
614 }
615
616 static void ___destory_agentDBHashTableKey(void *key)
617 {
618         _INNER_FUNC_ENTER;
619
620         _DEBUG_VERBOSE("[%s] start \n", __func__);
621         if ((unsigned int *)key != 0) {
622                 free((unsigned int *)key);
623         }
624         _INNER_FUNC_EXIT;
625
626 }
627
628 /*
629 static void __print_agentDBHashTableLog()
630 {
631         _DEBUG_VERBOSE("[%s] ---------HashKeyList --------\n", __func__);
632         int size = g_hash_table_size(pDBHandlerMgr->db_handlerTable);
633         _DEBUG_VERBOSE("[%s] pDBHandlerMgr->db_handlerTable Size is %d\n", __func__, size);
634         _DEBUG_VERBOSE("[%s] ----------------------------------------\n", __func__);
635         GList *iter = 0;
636         GList *keyList = g_hash_table_get_keys(pDBHandlerMgr->db_handlerTable);
637         for (iter = keyList; iter != 0; iter = g_list_next(iter))
638                 _DEBUG_VERBOSE("[%s] Handler Key  %d\n", __func__, *((unsigned int *)(iter->data)));
639         _DEBUG_VERBOSE("[%s] ----------------------------------------\n", __func__);
640 }
641 */