persistentstorage/sql/SRC/Server/SqlSrvSession.inl
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17 */
       
    18 inline void CSqlSrvSession::ConstructL()
       
    19 	{
       
    20 	}
       
    21 
       
    22 /**
       
    23 */
       
    24 inline CSqlSrvSession::CSqlSrvSession()
       
    25 	{
       
    26 	}
       
    27 
       
    28 /**
       
    29 @return A reference to CSqlServer instance.
       
    30 */
       
    31 inline CSqlServer& CSqlSrvSession::Server()
       
    32 	{
       
    33 	return *static_cast<CSqlServer*>(const_cast<CServer2*>(CSession2::Server()));
       
    34 	}
       
    35 	
       
    36 /**
       
    37 Destroys CSqlSrvDatabase instance.
       
    38 */
       
    39 inline void CSqlSrvSession::DbDestroyObject()
       
    40 	{
       
    41 	delete iDatabase;
       
    42 	iDatabase = NULL;
       
    43 	}
       
    44 
       
    45 /**
       
    46 Processes request for executing 8-bit SQL statement(s).
       
    47 
       
    48 The method requires a valid iDatabase object.
       
    49 
       
    50 Usage of the IPC call arguments:
       
    51 Arg 0: [in]	8-bit character length of SQL statement.
       
    52 Arg 1: [in]	SQL statement.
       
    53 
       
    54 @panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
       
    55 */
       
    56 inline TInt CSqlSrvSession::DbExecSql8L(const RMessage2& aMessage)
       
    57 	{
       
    58 	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
       
    59 	iDatabase->ExecL(ReadString8ZL(aMessage, 1, aMessage.Int0()));
       
    60 	return iDatabase->LastChangesCount();
       
    61 	}
       
    62 
       
    63 /**
       
    64 Processes request for executing 16-bit SQL statement(s).
       
    65 
       
    66 The method requires a valid iDatabase object.
       
    67 
       
    68 Usage of the IPC call arguments:
       
    69 Arg 0: [in]	16-bit character length of SQL statement.
       
    70 Arg 1: [in]	SQL statement.
       
    71 
       
    72 @panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
       
    73 */
       
    74 inline TInt CSqlSrvSession::DbExecSql16L(const RMessage2& aMessage)
       
    75 	{
       
    76 	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
       
    77 	iDatabase->ExecL(ReadString16ZL(aMessage, 1, aMessage.Int0()));
       
    78 	return iDatabase->LastChangesCount();
       
    79 	}
       
    80 
       
    81 /**
       
    82 Processes the request for setting the database isolation level.
       
    83 
       
    84 The method requires a valid iDatabase object.
       
    85 
       
    86 Usage of the IPC call arguments:
       
    87 Arg 0: [in]	Database isolation level.
       
    88 
       
    89 @panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
       
    90 */
       
    91 inline void CSqlSrvSession::DbSetIsolationLevelL(const RMessage2& aMessage)
       
    92 	{
       
    93 	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
       
    94 	RSqlDatabase::TIsolationLevel level = static_cast <RSqlDatabase::TIsolationLevel> (aMessage.Int0());
       
    95 	iDatabase->SetIsolationLevelL(level);
       
    96 	}