tizen 2.4 release
[framework/web/wrt-commons.git] / modules / db / include / dpl / db / thread_database_support.h
old mode 100644 (file)
new mode 100755 (executable)
similarity index 92%
rename from modules_wearable/db/include/dpl/db/thread_database_support.h
rename to modules/db/include/dpl/db/thread_database_support.h
index 04ec923..5c3239d
@@ -24,6 +24,7 @@
 #define DPL_THREAD_DATABASE_SUPPORT_H
 
 #include <string>
+#include <dpl/log/wrt_log.h>
 #include <dpl/db/sql_connection.h>
 #include <dpl/db/orm_interface.h>
 #include <dpl/thread.h>
@@ -97,7 +98,7 @@ class ThreadDatabaseSupport :
         }
 
         // Destroy connection
-        LogDebug("Destroying thread database connection: " << m_address);
+        WrtLogD("Destroying thread database connection: %s", m_address.c_str());
 
         delete *Connection();
 
@@ -119,16 +120,16 @@ class ThreadDatabaseSupport :
 
     void TransactionUnref()
     {
-        LogPedantic("Unref transaction");
+        WrtLogD("Unref transaction");
 
         if (--(*TransactionDepth()) == 0) {
-            LogPedantic("Transaction is finalized");
+            WrtLogD("Transaction is finalized");
 
             if (*TransactionCancel()) {
-                LogPedantic("Transaction will be rolled back");
+                WrtLogD("Transaction will be rolled back");
                 (*Connection())->RollbackTransaction();
             } else {
-                LogPedantic("Transaction will be commited");
+                WrtLogD("Transaction will be commited");
                 (*Connection())->CommitTransaction();
             }
         }
@@ -157,7 +158,7 @@ class ThreadDatabaseSupport :
         }
 
         // Initialize SQL connection described in traits
-        LogDebug("Attaching thread database connection: " << m_address);
+        WrtLogD("Attaching thread database connection: %s", m_address.c_str());
 
         Connection() = new DPL::DB::SqlConnection(
                 m_address.c_str(), m_flags, options);
@@ -194,7 +195,7 @@ class ThreadDatabaseSupport :
         // It must not be in linger state yet
         Assert(*Linger() == false);
 
-        LogDebug("Detaching thread database connection: " << m_address);
+        WrtLogD("Detaching thread database connection: %s", m_address.c_str());
 
         // Enter linger state
         *Linger() = true;
@@ -246,11 +247,11 @@ class ThreadDatabaseSupport :
         // Calling thread must support thread database connections
         Assert(!Connection().IsNull());
 
-        LogPedantic("Begin transaction");
+        WrtLogD("Begin transaction");
 
         // Addref transaction
         if (++(*TransactionDepth()) == 1) {
-            LogPedantic("Transaction is initialized");
+            WrtLogD("Transaction is initialized");
 
             TransactionCancel() = false;
             (*Connection())->BeginTransaction();
@@ -262,7 +263,7 @@ class ThreadDatabaseSupport :
         // Calling thread must support thread database connections
         Assert(!Connection().IsNull());
 
-        LogPedantic("Commit transaction");
+        WrtLogD("Commit transaction");
 
         // Unref transation
         TransactionUnref();