persistentstorage/sql/SRC/Client/SQLDatabase.cpp
branchRCL_3
changeset 23 26645d81f48d
parent 0 08ec8eefde2f
child 24 cc28652e0254
equal deleted inserted replaced
21:28839de615b4 23:26645d81f48d
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
    16 #include "SqlPanic.h"			//ESqlPanicInvalidObj, ESqlPanicObjExists
    16 #include "SqlAssert.h"			//ESqlPanicInvalidObj, ESqlPanicObjExists
    17 #include "SqlDatabaseImpl.h"	//CSqlDatabaseImpl
    17 #include "SqlDatabaseImpl.h"	//CSqlDatabaseImpl
       
    18 #include "OstTraceDefinitions.h"
       
    19 #ifdef OST_TRACE_COMPILER_IN_USE
       
    20 #include "SqlDatabaseTraces.h"
       
    21 #endif
       
    22 #include "SqlTraceDef.h"
    18 
    23 
    19 /**
    24 /**
    20 Gets the category of the return code value that is returned by
    25 Gets the category of the return code value that is returned by
    21 a call to the SQL API.
    26 a call to the SQL API.
    22 
    27 
    93 
    98 
    94 @capability None
    99 @capability None
    95 */
   100 */
    96 EXPORT_C TInt RSqlDatabase::Create(const TDesC& aDbFileName, const TDesC8* aConfig)
   101 EXPORT_C TInt RSqlDatabase::Create(const TDesC& aDbFileName, const TDesC8* aConfig)
    97 	{
   102 	{
    98 	SQLUTRACE_PROFILER(this);
   103     __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
    99 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
   104 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   100 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
   105 	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_CREATE_ENTRY, "Entry;0x%X;RSqlDatabase::Create;aDbFileName=%S;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR8(config, des16prnbuf)));
   101 			KStrParam, 2, aConfig) : void(0));
       
   102 	
       
   103 	TRAPD(err, iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreate, aDbFileName, NULL, aConfig));
   106 	TRAPD(err, iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreate, aDbFileName, NULL, aConfig));
       
   107     SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_CREATE_Exit, "Exit;0x%X;RSqlDatabase::Create;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
   104 	return err;
   108 	return err;
   105 	}
   109 	}
   106 	
   110 	
   107 /**
   111 /**
   108 Creates a new shared secure database.
   112 Creates a new shared secure database.
   144 @see RSqlSecurityPolicy::TPolicyType
   148 @see RSqlSecurityPolicy::TPolicyType
   145 */
   149 */
   146 EXPORT_C TInt RSqlDatabase::Create(const TDesC& aDbFileName,
   150 EXPORT_C TInt RSqlDatabase::Create(const TDesC& aDbFileName,
   147 						const RSqlSecurityPolicy& aSecurityPolicy, const TDesC8* aConfig)
   151 						const RSqlSecurityPolicy& aSecurityPolicy, const TDesC8* aConfig)
   148 	{
   152 	{
   149 	SQLUTRACE_PROFILER(this);
   153     __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
   150 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
   154 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   151 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
   155     SQL_TRACE_BORDER(OstTraceExt4(TRACE_BORDER, RSQLDATABASE_CREATE2_ENTRY, "Entry;0x%X;RSqlDatabase::Create;aDbFileName=%S;aSecurityPolicy=0x%X;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), (TUint)&aSecurityPolicy, __SQLPRNSTR8(config, des16prnbuf)));
   152 			KStrParam, 2, aConfig) : void(0));
   156 	TRAPD(err, 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreateSecure, aDbFileName, &aSecurityPolicy.Impl(), aConfig));
   153 	
   157     SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_CREATE2_Exit, "Exit;0x%X;RSqlDatabase::Create;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
   154 	TRAPD(err, 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreateSecure, aDbFileName,
       
   155 			&aSecurityPolicy.Impl(), aConfig));
       
   156 	return err;
   158 	return err;
   157 	}
   159 	}
   158 	
   160 	
   159 /**
   161 /**
   160 Opens an existing database, which can be:
   162 Opens an existing database, which can be:
   197 @see RSqlSecurityPolicy
   199 @see RSqlSecurityPolicy
   198 @see RSqlSecurityPolicy::TPolicyType
   200 @see RSqlSecurityPolicy::TPolicyType
   199 */
   201 */
   200 EXPORT_C TInt RSqlDatabase::Open(const TDesC& aDbFileName, const TDesC8* aConfig)
   202 EXPORT_C TInt RSqlDatabase::Open(const TDesC& aDbFileName, const TDesC8* aConfig)
   201 	{
   203 	{
   202 	SQLUTRACE_PROFILER(this);
   204     __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
   203 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
   205 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   204 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
   206     SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_OPEN_ENTRY, "Entry;0x%X;RSqlDatabase::Open;aDbFileName=%S;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR8(config, des16prnbuf)));
   205 			KStrParam, 2, aConfig) : void(0));
       
   206 	
       
   207 	TRAPD(err, iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbOpen, aDbFileName, NULL, aConfig));
   207 	TRAPD(err, iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbOpen, aDbFileName, NULL, aConfig));
       
   208     SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_OPEN_EXIT, "Exit;0x%X;RSqlDatabase::Open;iImpl=0x%X;err=%d", (TUint)this, (TUint)iImpl, err));
   208 	return err;
   209 	return err;
   209 	}
   210 	}
   210 
   211 
   211 /**
   212 /**
   212 Creates a new shared non-secure or private secure database.
   213 Creates a new shared non-secure or private secure database.
   238 
   239 
   239 @capability None
   240 @capability None
   240 */
   241 */
   241 EXPORT_C void RSqlDatabase::CreateL(const TDesC& aDbFileName, const TDesC8* aConfig)
   242 EXPORT_C void RSqlDatabase::CreateL(const TDesC& aDbFileName, const TDesC8* aConfig)
   242 	{
   243 	{
   243 	SQLUTRACE_PROFILER(this);
   244     __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
   244 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
   245 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   245 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
   246     SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_CREATEL_ENTRY, "Entry;0x%X;RSqlDatabase::CreateL;aDbFileName=%S;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR8(config, des16prnbuf)));
   246 			KStrParam, 2, aConfig) : void(0));
       
   247 	
       
   248 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreate, aDbFileName, NULL, aConfig);
   247 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreate, aDbFileName, NULL, aConfig);
       
   248     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_CREATEL_EXIT, "Entry;0x%X;RSqlDatabase::CreateL;iImpl=0x%X", (TUint)this, (TUint)iImpl));
   249 	}
   249 	}
   250 	
   250 	
   251 /**
   251 /**
   252 Creates a new shared secure database.
   252 Creates a new shared secure database.
   253 @param aDbFileName       The name of the file that is to host the database.
   253 @param aDbFileName       The name of the file that is to host the database.
   286 @see RSqlSecurityPolicy::TPolicyType
   286 @see RSqlSecurityPolicy::TPolicyType
   287 */
   287 */
   288 EXPORT_C void RSqlDatabase::CreateL(const TDesC& aDbFileName,
   288 EXPORT_C void RSqlDatabase::CreateL(const TDesC& aDbFileName,
   289 				const RSqlSecurityPolicy& aSecurityPolicy, const TDesC8* aConfig)
   289 				const RSqlSecurityPolicy& aSecurityPolicy, const TDesC8* aConfig)
   290 	{
   290 	{
   291 	SQLUTRACE_PROFILER(this);
   291     __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
   292 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
   292 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   293 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
   293     SQL_TRACE_BORDER(OstTraceExt4(TRACE_BORDER, RSQLDATABASE_CREATEL2_ENTRY, "Entry;0x%X;RSqlDatabase::CreateL;aDbFileName=%S;aSecurityPolicy=0x%X;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), (TUint)&aSecurityPolicy, __SQLPRNSTR8(config, des16prnbuf)));
   294 			KStrParam, 2, aConfig) : void(0));
   294 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreateSecure, aDbFileName, &aSecurityPolicy.Impl(), aConfig);
   295 	
   295     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_CREATEL2_EXIT, "Exit;0x%X;RSqlDatabase::CreateL;iImpl=0x%X", (TUint)this, (TUint)iImpl));
   296 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbCreateSecure, aDbFileName,
       
   297 						&aSecurityPolicy.Impl(), aConfig);
       
   298 	}
   296 	}
   299 	
   297 	
   300 /**
   298 /**
   301 Opens an existing database, which can be:
   299 Opens an existing database, which can be:
   302 @code
   300 @code
   337 @see RSqlSecurityPolicy
   335 @see RSqlSecurityPolicy
   338 @see RSqlSecurityPolicy::TPolicyType
   336 @see RSqlSecurityPolicy::TPolicyType
   339 */
   337 */
   340 EXPORT_C void RSqlDatabase::OpenL(const TDesC& aDbFileName, const TDesC8* aConfig)
   338 EXPORT_C void RSqlDatabase::OpenL(const TDesC& aDbFileName, const TDesC8* aConfig)
   341 	{
   339 	{
   342 	SQLUTRACE_PROFILER(this);
   340     __SQLTRACE_BORDEREXPR(TPtrC8 config(aConfig ? *aConfig : KNullDesC8));
   343 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
   341     SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_OPENL_ENTRY, "Entry;0x%X;RSqlDatabase::OpenL;aDbFileName=%S;aConfig=%s", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR(config)));
   344 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(aConfig ? (void)UTF::Printf(UTF::TTraceContext(UTF::EInternals), 
       
   345 			KStrParam, 2, aConfig) : void(0));
       
   346 	
       
   347 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbOpen, aDbFileName, NULL, aConfig);
   342 	iImpl = CSqlDatabaseImpl::NewL(ESqlSrvDbOpen, aDbFileName, NULL, aConfig);
       
   343     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_OPENL_EXIT, "Exit;0x%X;RSqlDatabase::OpenL;iImpl=0x%X", (TUint)this, (TUint)iImpl));
   348 	}
   344 	}
   349 
   345 
   350 /**
   346 /**
   351 Closes this handle to the database.
   347 Closes this handle to the database.
   352 
   348 
   360 
   356 
   361 @capability None
   357 @capability None
   362 */
   358 */
   363 EXPORT_C void RSqlDatabase::Close()
   359 EXPORT_C void RSqlDatabase::Close()
   364 	{
   360 	{
   365 	SQLUTRACE_PROFILER(this);
   361     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_CLOSE_ENTRY, "Entry;0x%X;RSqlDatabase::Close;iImpl=0x%X", (TUint)this, (TUint)iImpl));
   366 	delete iImpl;
   362 	delete iImpl;
       
   363     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_CLOSE_EXIT, "Exit;0x%X;RSqlDatabase::Close;iImpl=0x%X", (TUint)this, (TUint)iImpl));
   367 	iImpl = NULL;
   364 	iImpl = NULL;
   368 	}
   365 	}
   369 	
   366 	
   370 /**
   367 /**
   371 Attaches an existing database to the current database connection.
   368 Attaches an existing database to the current database connection.
   406 @see RSqlSecurityPolicy
   403 @see RSqlSecurityPolicy
   407 @see RSqlSecurityPolicy::TPolicyType
   404 @see RSqlSecurityPolicy::TPolicyType
   408 */
   405 */
   409 EXPORT_C TInt RSqlDatabase::Attach(const TDesC& aDbFileName, const TDesC& aDbName)
   406 EXPORT_C TInt RSqlDatabase::Attach(const TDesC& aDbFileName, const TDesC& aDbName)
   410 	{
   407 	{
   411 	SQLUTRACE_PROFILER(this);
   408     SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_ATTACH_ENTRY, "Entry;0x%X;RSqlDatabase::Attach;aDbFileName=%S;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbFileName), __SQLPRNSTR(aDbName)));
   412 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrStrParam16, &aDbFileName, &aDbName));
   409 	TInt err = Impl().Attach(aDbFileName, aDbName);
   413 	
   410     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_ATTACH_EXIT, "Entry;0x%X;RSqlDatabase::Attach;err=%d", (TUint)this, err));
   414 	return Impl().Attach(aDbFileName, aDbName);
   411 	return err;
   415 	}
   412 	}
   416 		
   413 		
   417 /**
   414 /**
   418 Detaches previously attached database.
   415 Detaches previously attached database.
   419 
   416 
   427 
   424 
   428 @capability None
   425 @capability None
   429 */
   426 */
   430 EXPORT_C TInt RSqlDatabase::Detach(const TDesC& aDbName)
   427 EXPORT_C TInt RSqlDatabase::Detach(const TDesC& aDbName)
   431 	{
   428 	{
   432 	SQLUTRACE_PROFILER(this);
   429     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_DETACH_ENTRY, "Entry;0x%X;RSqlDatabase::Detach;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbName)));
   433 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbName));
   430 	TInt err = Impl().Detach(aDbName);
   434 	
   431     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_DETACH_EXIT, "Exit;0x%X;RSqlDatabase::Detach;err=%d", (TUint)this, err));
   435 	return Impl().Detach(aDbName);
   432 	return err;
   436 	}
   433 	}
   437 
   434 
   438 /**
   435 /**
   439 Copies a database file to the specified location.
   436 Copies a database file to the specified location.
   440 
   437 
   468 
   465 
   469 Note that if the source database is a secure database, only the application, which created the database, can copy it.
   466 Note that if the source database is a secure database, only the application, which created the database, can copy it.
   470 */
   467 */
   471 EXPORT_C TInt RSqlDatabase::Copy(const TDesC& aSrcDbFileName, const TDesC& aDestDbFileName)
   468 EXPORT_C TInt RSqlDatabase::Copy(const TDesC& aSrcDbFileName, const TDesC& aDestDbFileName)
   472 	{
   469 	{
   473 	SQLUTRACE_PROFILER(0);
   470     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_COPY_ENTRY, "Entry;0;RSqlDatabase::Copy;aSrcDbFileName=%S;aDestDbFileName=%S", __SQLPRNSTR(aSrcDbFileName), __SQLPRNSTR(aDestDbFileName)));
   474 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrStrParam16, 
   471 	TInt err = CSqlDatabaseImpl::Copy(aSrcDbFileName, aDestDbFileName);
   475 			&aSrcDbFileName, &aDestDbFileName));
   472     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_COPY_EXIT, "Exit;0;RSqlDatabase::Copy;err=%d", err));
   476 
   473 	return err;
   477 	return CSqlDatabaseImpl::Copy(aSrcDbFileName, aDestDbFileName);
       
   478 	}
   474 	}
   479 	
   475 	
   480 /**
   476 /**
   481 Deletes the specified database file.
   477 Deletes the specified database file.
   482 
   478 
   502 
   498 
   503 Note that if the database to be deleted is a secure database, only the application, which created the database, can delete it.
   499 Note that if the database to be deleted is a secure database, only the application, which created the database, can delete it.
   504 */
   500 */
   505 EXPORT_C TInt RSqlDatabase::Delete(const TDesC& aDbFileName)
   501 EXPORT_C TInt RSqlDatabase::Delete(const TDesC& aDbFileName)
   506 	{
   502 	{
   507 	SQLUTRACE_PROFILER(0);
   503     SQL_TRACE_BORDER(OstTraceExt1(TRACE_BORDER, RSQLDATABASE_DELETE_ENTRY, "Entry;0;RSqlDatabase::Delete;aDbFileName=%S", __SQLPRNSTR(aDbFileName)));
   508 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aDbFileName));
   504 	TInt err = CSqlDatabaseImpl::Delete(aDbFileName);
   509 	
   505     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_DELETE_EXIT, "Exit;0;RSqlDatabase::Delete;err=%d", err));
   510 	return CSqlDatabaseImpl::Delete(aDbFileName);
   506 	return err;
   511 	}
   507 	}
   512 	
   508 	
   513 /**
   509 /**
   514 Initializes aSecurityPolicy output parameter with a copy of the database security policies.
   510 Initializes aSecurityPolicy output parameter with a copy of the database security policies.
   515 The caller is responsible for destroying the initialized aSecurityPolicy paramemter.
   511 The caller is responsible for destroying the initialized aSecurityPolicy paramemter.
   525 
   521 
   526 @capability None
   522 @capability None
   527 */
   523 */
   528 EXPORT_C TInt RSqlDatabase::GetSecurityPolicy(RSqlSecurityPolicy& aSecurityPolicy) const
   524 EXPORT_C TInt RSqlDatabase::GetSecurityPolicy(RSqlSecurityPolicy& aSecurityPolicy) const
   529 	{
   525 	{
   530 	SQLUTRACE_PROFILER(this);
   526     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_GETSECURITYPOLICY_ENTRY, "Entry;0x%X;RSqlDatabase::GetSecurityPolicy;aSecurityPolicy=0x%X", (TUint)this, (TUint)&aSecurityPolicy));
   531 	TRAPD(err, CSqlSecurityPolicy* securityPolicy = Impl().CloneSecurityPolicyL();
   527 	TRAPD(err, CSqlSecurityPolicy* securityPolicy = Impl().CloneSecurityPolicyL(); aSecurityPolicy.Set(*securityPolicy));
   532 		aSecurityPolicy.Set(*securityPolicy));
   528     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_GETSECURITYPOLICY_EXIT, "Exit;0x%X;RSqlDatabase::GetSecurityPolicy;err=%d", (TUint)this, err));
   533 	
       
   534 	return err;
   529 	return err;
   535 	}
   530 	}
   536 	
   531 	
   537 /**
   532 /**
   538 Initializes aSecurityPolicy output parameter with a copy of the database security policies.
   533 Initializes aSecurityPolicy output parameter with a copy of the database security policies.
   548 
   543 
   549 @capability None
   544 @capability None
   550 */
   545 */
   551 EXPORT_C void RSqlDatabase::GetSecurityPolicyL(RSqlSecurityPolicy& aSecurityPolicy) const
   546 EXPORT_C void RSqlDatabase::GetSecurityPolicyL(RSqlSecurityPolicy& aSecurityPolicy) const
   552 	{
   547 	{
   553 	SQLUTRACE_PROFILER(this);
   548     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_GETSECURITYPOLICYL_ENTRY, "Entry;0x%X;RSqlDatabase::GetSecurityPolicyL;aSecurityPolicy=0x%X", (TUint)this, (TUint)&aSecurityPolicy));
   554 	CSqlSecurityPolicy* securityPolicy = Impl().CloneSecurityPolicyL();
   549 	CSqlSecurityPolicy* securityPolicy = Impl().CloneSecurityPolicyL();
   555 	aSecurityPolicy.Set(*securityPolicy);	
   550 	aSecurityPolicy.Set(*securityPolicy);	
       
   551     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_GETSECURITYPOLICYL_EXIT, "Exit;0x%X;RSqlDatabase::GetSecurityPolicyL", (TUint)this));
   556 	}
   552 	}
   557 	
   553 	
   558 /**
   554 /**
   559 Sets the transaction isolation level for the database.
   555 Sets the transaction isolation level for the database.
   560 
   556 
   579 
   575 
   580 @capability None
   576 @capability None
   581 */
   577 */
   582 EXPORT_C TInt RSqlDatabase::SetIsolationLevel(RSqlDatabase::TIsolationLevel aIsolationLevel)
   578 EXPORT_C TInt RSqlDatabase::SetIsolationLevel(RSqlDatabase::TIsolationLevel aIsolationLevel)
   583 	{
   579 	{
   584 	SQLUTRACE_PROFILER(this);
   580     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_SETISOLATIONLEVEL_ENTRY, "Entry;0x%X;RSqlDatabase::SetIsolationLevel;aIsolationLevel=%d", (TUint)this, aIsolationLevel));
   585 	return Impl().SetIsolationLevel(aIsolationLevel);
   581 	TInt err = Impl().SetIsolationLevel(aIsolationLevel);
       
   582     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_SETISOLATIONLEVEL_EXIT, "Exit;0x%X;RSqlDatabase::SetIsolationLevel;err=%d", (TUint)this, err));
       
   583 	return err;
   586 	}
   584 	}
   587 	
   585 	
   588 /**
   586 /**
   589 Executes one or more 16-bit SQL statements.
   587 Executes one or more 16-bit SQL statements.
   590 
   588 
   630 @see RSqlSecurityPolicy
   628 @see RSqlSecurityPolicy
   631 @see RSqlSecurityPolicy::TPolicyType
   629 @see RSqlSecurityPolicy::TPolicyType
   632 */
   630 */
   633 EXPORT_C TInt RSqlDatabase::Exec(const TDesC& aSqlStmt)
   631 EXPORT_C TInt RSqlDatabase::Exec(const TDesC& aSqlStmt)
   634 	{
   632 	{
   635 	SQLUTRACE_PROFILER(this);
   633     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXEC16_ENTRY, "Entry;0x%X;RSqlDatabase::Exec16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
   636 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
   634 	TInt err = Impl().Exec(aSqlStmt);
   637 
   635     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXEC16_EXIT, "Exit;0x%X;RSqlDatabase::Exec16;err=%d", (TUint)this, err));
   638 	return Impl().Exec(aSqlStmt);
   636     return err;
   639 	}
   637 	}
   640 	
   638 	
   641 /**
   639 /**
   642 Executes one or more 8-bit SQL statements.
   640 Executes one or more 8-bit SQL statements.
   643 
   641 
   683 @see RSqlSecurityPolicy
   681 @see RSqlSecurityPolicy
   684 @see RSqlSecurityPolicy::TPolicyType
   682 @see RSqlSecurityPolicy::TPolicyType
   685 */
   683 */
   686 EXPORT_C TInt RSqlDatabase::Exec(const TDesC8& aSqlStmt)
   684 EXPORT_C TInt RSqlDatabase::Exec(const TDesC8& aSqlStmt)
   687 	{
   685 	{
   688 	SQLUTRACE_PROFILER(this);
   686 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   689 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
   687     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXEC8_ENTRY, "Entry;0x%X;RSqlDatabase::Exec8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
   690 
   688 	TInt err = Impl().Exec(aSqlStmt);
   691 	return Impl().Exec(aSqlStmt);
   689     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXEC8_EXIT, "Exit;0x%X;RSqlDatabase::Exec8;err=%d", (TUint)this, err));
       
   690 	return err;
   692 	}
   691 	}
   693 
   692 
   694 /**
   693 /**
   695 Executes one or more 16-bit SQL statements asynchronously to allow client to avoid being blocked 
   694 Executes one or more 16-bit SQL statements asynchronously to allow client to avoid being blocked 
   696 by server activity.
   695 by server activity.
   741 @see RSqlSecurityPolicy
   740 @see RSqlSecurityPolicy
   742 @see RSqlSecurityPolicy::TPolicyType
   741 @see RSqlSecurityPolicy::TPolicyType
   743 */
   742 */
   744 EXPORT_C void RSqlDatabase::Exec(const TDesC& aSqlStmt, TRequestStatus& aStatus)
   743 EXPORT_C void RSqlDatabase::Exec(const TDesC& aSqlStmt, TRequestStatus& aStatus)
   745 	{
   744 	{
   746 	SQLUTRACE_PROFILER(this);
   745     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXECASYNC16_ENTRY, "Entry;0x%X;RSqlDatabase::ExecAsync16;aSqlStmt=%S", (TUint)this, __SQLPRNSTR(aSqlStmt)));
   747 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 1, &aSqlStmt));
       
   748 
       
   749 	Impl().Exec(aSqlStmt, aStatus);
   746 	Impl().Exec(aSqlStmt, aStatus);
       
   747     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXECASYNC16_EXIT, "Exit;0x%X;RSqlDatabase::ExecAsync16;aStatus.Int()=%d", (TUint)this, aStatus.Int()));
   750 	}
   748 	}
   751 
   749 
   752 /**
   750 /**
   753 Executes one or more 8-bit SQL statements asynchronously to allow client to avoid being blocked 
   751 Executes one or more 8-bit SQL statements asynchronously to allow client to avoid being blocked 
   754 by server activity.
   752 by server activity.
   799 @see RSqlSecurityPolicy
   797 @see RSqlSecurityPolicy
   800 @see RSqlSecurityPolicy::TPolicyType
   798 @see RSqlSecurityPolicy::TPolicyType
   801 */
   799 */
   802 EXPORT_C void RSqlDatabase::Exec(const TDesC8& aSqlStmt, TRequestStatus& aStatus)
   800 EXPORT_C void RSqlDatabase::Exec(const TDesC8& aSqlStmt, TRequestStatus& aStatus)
   803 	{
   801 	{
   804 	SQLUTRACE_PROFILER(this);
   802 	__SQLTRACE_BORDERVAR(TBuf<100> des16prnbuf);
   805 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam, 1, &aSqlStmt));
   803     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXECASYNC8_ENTRY, "Entry;0x%X;RSqlDatabase::ExecAsync8;aSqlStmt=%s", (TUint)this, __SQLPRNSTR8(aSqlStmt, des16prnbuf)));
   806 
       
   807 	Impl().Exec(aSqlStmt, aStatus);
   804 	Impl().Exec(aSqlStmt, aStatus);
       
   805     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_EXECASYNC8_EXIT, "Exit;0x%X;RSqlDatabase::ExecAsync8;aStatus.Int()=%d", (TUint)this, aStatus.Int()));
   808 	}
   806 	}
   809 	
   807 	
   810 /**
   808 /**
   811 Retrieves a reference to the textual description of the error returned by the
   809 Retrieves a reference to the textual description of the error returned by the
   812 most recent call to any of the functions:
   810 most recent call to any of the functions:
   831 
   829 
   832 @capability None
   830 @capability None
   833 */
   831 */
   834 EXPORT_C TPtrC RSqlDatabase::LastErrorMessage() const
   832 EXPORT_C TPtrC RSqlDatabase::LastErrorMessage() const
   835 	{
   833 	{
   836 	SQLUTRACE_PROFILER(0);
   834 	TPtrC msg(Impl().LastErrorMessage());
   837 	return Impl().LastErrorMessage();
   835     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_LASTERRORMESSAGE, "0x%X;RSqlDatabase::LastErrorMessage;msg=%S", (TUint)this, __SQLPRNSTR(msg)));
       
   836 	return msg;
   838 	}
   837 	}
   839 
   838 
   840 /**
   839 /**
   841 Returns the ROWID of the most recent successful INSERT into the database 
   840 Returns the ROWID of the most recent successful INSERT into the database 
   842 from this database connection.
   841 from this database connection.
   848 
   847 
   849 @capability None
   848 @capability None
   850 */
   849 */
   851 EXPORT_C TInt64 RSqlDatabase::LastInsertedRowId() const
   850 EXPORT_C TInt64 RSqlDatabase::LastInsertedRowId() const
   852 	{
   851 	{
   853 	SQLUTRACE_PROFILER(0);
   852     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_LASTINSERTEDROWID_ENTRY, "Entry;0x%X;RSqlDatabase::LastInsertedRowId", (TUint)this));
   854 	return Impl().LastInsertedRowId();	
   853 	TInt64 rc = Impl().LastInsertedRowId();
       
   854 	SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_LASTINSERTEDROWID_EXIT, "Exit;0x%X;RSqlDatabase::LastInsertedRowId;RowId=%lld", (TUint)this, rc));
       
   855 	return rc;
   855 	}
   856 	}
   856 
   857 
   857 /**
   858 /**
   858 Checks the database transaction state.
   859 Checks the database transaction state.
   859 
   860 
   861 
   862 
   862 @capability None
   863 @capability None
   863 */
   864 */
   864 EXPORT_C TBool RSqlDatabase::InTransaction() const
   865 EXPORT_C TBool RSqlDatabase::InTransaction() const
   865 	{
   866 	{
   866 	SQLUTRACE_PROFILER(0);
   867     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_INTRABSACTION_ENTRY, "Entry;0x%X;RSqlDatabase::InTransaction", (TUint)this));
   867 	return Impl().InTransaction();
   868 	TBool res = Impl().InTransaction();
       
   869     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_INTRABSACTION_EXIT, "Exit;0x%X;RSqlDatabase::InTransaction;res=%d", (TUint)this, res));
       
   870 	return res;
   868 	}
   871 	}
   869 	
   872 	
   870 /**
   873 /**
   871 Returns the database file size, in bytes.
   874 Returns the database file size, in bytes.
   872 
   875 
   879 
   882 
   880 @capability None
   883 @capability None
   881 */
   884 */
   882 EXPORT_C TInt RSqlDatabase::Size() const
   885 EXPORT_C TInt RSqlDatabase::Size() const
   883 	{
   886 	{
   884 	SQLUTRACE_PROFILER(0);
   887     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_SIZE_ENTRY, "Entry;0x%X;RSqlDatabase::Size", (TUint)this));
   885 	return Impl().Size();
   888 	TInt rc = Impl().Size();
       
   889     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_SIZE_EXIT, "Exit;0x%X;RSqlDatabase::Size;rc=%d", (TUint)this, rc));
       
   890 	return rc;
   886 	}
   891 	}
   887 
   892 
   888 /**
   893 /**
   889 Returns the database file size and free space, in bytes.
   894 Returns the database file size and free space, in bytes.
   890 
   895 
   900                   
   905                   
   901 @capability None
   906 @capability None
   902 */
   907 */
   903 EXPORT_C TInt RSqlDatabase::Size(RSqlDatabase::TSize& aSize, const TDesC& aDbName) const
   908 EXPORT_C TInt RSqlDatabase::Size(RSqlDatabase::TSize& aSize, const TDesC& aDbName) const
   904 	{
   909 	{
   905 	SQLUTRACE_PROFILER(0);
   910     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_SIZE2_ENTRY, "Entry;0x%X;RSqlDatabase::Size-2;aDbName=%S", (TUint)this, __SQLPRNSTR(aDbName)));
   906 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KStrParam16, 2, &aDbName));
   911 	TInt err = Impl().Size(aSize, aDbName);
   907 	
   912     SQL_TRACE_BORDER(OstTraceExt4(TRACE_BORDER, RSQLDATABASE_SIZE2_EXIT, "Exit;0x%X;RSqlDatabase::Size-2;err=%d;aSize.iSize=%lld;aSize.iFree=%lld", (TUint)this, err, aSize.iSize, aSize.iFree));
   908 	return Impl().Size(aSize, aDbName);
   913 	return err;
   909 	}
   914 	}
   910 
   915 
   911 /**
   916 /**
   912 Compacts the database.
   917 Compacts the database.
   913 This function should be used for databases that have been configured for a manual compaction during 
   918 This function should be used for databases that have been configured for a manual compaction during 
   938                   
   943                   
   939 @capability None
   944 @capability None
   940 */
   945 */
   941 EXPORT_C TInt RSqlDatabase::Compact(TInt64 aSize, const TDesC& aDbName)
   946 EXPORT_C TInt RSqlDatabase::Compact(TInt64 aSize, const TDesC& aDbName)
   942 	{
   947 	{
   943 	SQLUTRACE_PROFILER(this);
   948 	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_COMPACT_ENTRY, "Entry;0x%X;RSqlDatabase::Compact;aSize=%lld;aDbName=%S", (TUint)this, aSize, __SQLPRNSTR(aDbName)));
   944 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSizeStrParam16, 1, aSize, 2, &aDbName));
   949 	TInt rc = Impl().Compact(aSize, aDbName);
   945 
   950     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_COMPACT_EXIT, "Exit;0x%X;RSqlDatabase::Compact;rc=%d", (TUint)this, rc));
   946 	return Impl().Compact(aSize, aDbName);
   951 	return rc;
   947 	}
   952 	}
   948 	
   953 	
   949 /**
   954 /**
   950 Compacts the database asynchronously.
   955 Compacts the database asynchronously.
   951 This function should be used for databases that have been configured for a manual compaction during 
   956 This function should be used for databases that have been configured for a manual compaction during 
   978                   
   983                   
   979 @capability None
   984 @capability None
   980 */
   985 */
   981 EXPORT_C void RSqlDatabase::Compact(TInt64 aSize, TRequestStatus& aStatus, const TDesC& aDbName)
   986 EXPORT_C void RSqlDatabase::Compact(TInt64 aSize, TRequestStatus& aStatus, const TDesC& aDbName)
   982 	{
   987 	{
   983 	SQLUTRACE_PROFILER(this);
   988 	SQL_TRACE_BORDER(OstTraceExt3(TRACE_BORDER, RSQLDATABASE_COMPACTASYNC_ENTRY, "Entry;0x%X;RSqlDatabase::CompactAsync;aSize=%lld;aDbName=%S", (TUint)this, aSize, __SQLPRNSTR(aDbName)));
   984 	SYMBIAN_TRACE_SQL_EVENTS_ONLY(UTF::Printf(UTF::TTraceContext(UTF::EInternals), KSizeStrParam16, 1, aSize, 3, &aDbName));
       
   985 
       
   986 	Impl().Compact(aSize, aDbName, aStatus);
   989 	Impl().Compact(aSize, aDbName, aStatus);
       
   990     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_COMPACTASYNC_EXIT, "Exit;0x%X;RSqlDatabase::CompactAsync;aStatus.Int()=%d", (TUint)this, aStatus.Int()));
   987 	}
   991 	}
   988 
   992 
   989 /**
   993 /**
   990 Reserves a predefined amount of disk space on the drive where the database file is.
   994 Reserves a predefined amount of disk space on the drive where the database file is.
   991 
   995 
  1008 @see RSqlDatabase::GetReserveAccess()
  1012 @see RSqlDatabase::GetReserveAccess()
  1009 @see RSqlDatabase::ReleaseReserveAccess()
  1013 @see RSqlDatabase::ReleaseReserveAccess()
  1010 */
  1014 */
  1011 EXPORT_C TInt RSqlDatabase::ReserveDriveSpace(TInt aSize)
  1015 EXPORT_C TInt RSqlDatabase::ReserveDriveSpace(TInt aSize)
  1012 	{
  1016 	{
  1013 	SQLUTRACE_PROFILER(this);
  1017     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_RESERVEDRIVESPACE_ENTRY, "Entry;0x%X;RSqlDatabase::ReserveDriveSpace;aSize=%d", (TUint)this, aSize));
  1014 	//Usage of the IPC call arguments: 
  1018 	//Usage of the IPC call arguments: 
  1015 	//Arg 0: [out]  requested size
  1019 	//Arg 0: [out]  requested size
  1016 	return Impl().Session().SendReceive(ESqlSrvDbReserveDriveSpace, TIpcArgs(aSize));
  1020 	TInt err = Impl().Session().SendReceive(ESqlSrvDbReserveDriveSpace, TIpcArgs(aSize));
       
  1021     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_RESERVEDRIVESPACE_EXIT, "Exit;0x%X;RSqlDatabase::ReserveDriveSpace;err=%d", (TUint)this, err));
       
  1022     return err;
  1017 	}
  1023 	}
  1018 	
  1024 	
  1019 /**
  1025 /**
  1020 Frees the reserved disk space.
  1026 Frees the reserved disk space.
  1021 
  1027 
  1023 @see RSqlDatabase::GetReserveAccess()
  1029 @see RSqlDatabase::GetReserveAccess()
  1024 @see RSqlDatabase::ReleaseReserveAccess()
  1030 @see RSqlDatabase::ReleaseReserveAccess()
  1025 */
  1031 */
  1026 EXPORT_C void RSqlDatabase::FreeReservedSpace()
  1032 EXPORT_C void RSqlDatabase::FreeReservedSpace()
  1027 	{
  1033 	{
  1028 	SQLUTRACE_PROFILER(this);
  1034     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_FREERESERVEDSPACE_ENTRY, "Entry;0x%X;RSqlDatabase::FreeReservedSpace", (TUint)this));
  1029 	Impl().Session().SendReceive(ESqlSrvDbFreeReservedSpace);
  1035 	__SQLTRACE_BORDERVAR(TInt err =) Impl().Session().SendReceive(ESqlSrvDbFreeReservedSpace);
       
  1036     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_FREERESERVEDSPACE_EXIT, "Exit;0x%X;RSqlDatabase::FreeReservedSpace;err=%d", (TUint)this, err));
  1030 	}
  1037 	}
  1031 	
  1038 	
  1032 /**
  1039 /**
  1033 Gives the client an access to the already reserved disk space.
  1040 Gives the client an access to the already reserved disk space.
  1034 
  1041 
  1041 @see RSqlDatabase::FreeReservedSpace()
  1048 @see RSqlDatabase::FreeReservedSpace()
  1042 @see RSqlDatabase::ReleaseReserveAccess()
  1049 @see RSqlDatabase::ReleaseReserveAccess()
  1043 */
  1050 */
  1044 EXPORT_C TInt RSqlDatabase::GetReserveAccess()
  1051 EXPORT_C TInt RSqlDatabase::GetReserveAccess()
  1045 	{
  1052 	{
  1046 	SQLUTRACE_PROFILER(this);
  1053     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_GETRESERVEACCESS_ENTRY, "Exit;0x%X;RSqlDatabase::GetReserveAccess", (TUint)this));
  1047 	return Impl().Session().SendReceive(ESqlSrvDbGetReserveAccess);
  1054 	TInt err = Impl().Session().SendReceive(ESqlSrvDbGetReserveAccess);
       
  1055     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_GETRESERVEACCESS_EXIT, "Exit;0x%X;RSqlDatabase::GetReserveAccess;err=%d", (TUint)this, err));
       
  1056 	return err;
  1048 	}
  1057 	}
  1049 	
  1058 	
  1050 /**
  1059 /**
  1051 Releases the access to the reserved disk space.
  1060 Releases the access to the reserved disk space.
  1052 
  1061 
  1054 @see RSqlDatabase::FreeReservedSpace()
  1063 @see RSqlDatabase::FreeReservedSpace()
  1055 @see RSqlDatabase::GetReserveAccess()
  1064 @see RSqlDatabase::GetReserveAccess()
  1056 */
  1065 */
  1057 EXPORT_C void RSqlDatabase::ReleaseReserveAccess()
  1066 EXPORT_C void RSqlDatabase::ReleaseReserveAccess()
  1058 	{
  1067 	{
  1059 	SQLUTRACE_PROFILER(this);
  1068     SQL_TRACE_BORDER(OstTrace1(TRACE_BORDER, RSQLDATABASE_RELEASERESERVEACCESS_ENTRY, "Entry;0x%X;RSqlDatabase::ReleaseReserveAccess", (TUint)this));
  1060 	Impl().Session().SendReceive(ESqlSrvDbReleaseReserveAccess);
  1069 	__SQLTRACE_BORDERVAR(TInt err =) Impl().Session().SendReceive(ESqlSrvDbReleaseReserveAccess);
       
  1070     SQL_TRACE_BORDER(OstTraceExt2(TRACE_BORDER, RSQLDATABASE_RELEASERESERVEACCESS_EXIT, "Exit;0x%X;RSqlDatabase::ReleaseReserveAccess;err=%d", (TUint)this, err));
  1061 	}
  1071 	}
  1062 
  1072 
  1063 /**
  1073 /**
  1064 Returns a reference to the implementation object of RSqlDatabase - CSqlDatabaseImpl.
  1074 Returns a reference to the implementation object of RSqlDatabase - CSqlDatabaseImpl.
  1065 
  1075 
  1067 
  1077 
  1068 @internalComponent
  1078 @internalComponent
  1069 */
  1079 */
  1070 CSqlDatabaseImpl& RSqlDatabase::Impl() const
  1080 CSqlDatabaseImpl& RSqlDatabase::Impl() const
  1071 	{
  1081 	{
  1072 	__SQLASSERT_ALWAYS(iImpl != NULL, ESqlPanicInvalidObj);
  1082 	__ASSERT_ALWAYS(iImpl != NULL, __SQLPANIC(ESqlPanicInvalidObj));
  1073 	return *iImpl;	
  1083 	return *iImpl;	
  1074 	}
  1084 	}