diff --git a/.gitignore b/.gitignore
index 951d94454..cf52c1cab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -100,3 +100,6 @@ lib/
lib64/
pocomsg.h
+# Temporary files #
+###################
+*.bak
diff --git a/ApacheConnector/ApacheConnector_x64_vs100.vcxproj b/ApacheConnector/ApacheConnector_x64_vs100.vcxproj
index 1fcb7634f..2583983fb 100644
--- a/ApacheConnector/ApacheConnector_x64_vs100.vcxproj
+++ b/ApacheConnector/ApacheConnector_x64_vs100.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -16,40 +16,40 @@
ApacheConnector
Win32Proj
-
-
+
+
DynamicLibrary
MultiByte
-
+
DynamicLibrary
MultiByte
-
-
-
-
+
+
+
+
-
-
+
+
-
+
<_ProjectFileVersion>10.0.40219.1
- ..\bin64\
- obj64\$(Configuration)\
- true
- ..\bin64\
- obj64\$(Configuration)\
- false
- mod_poco64d
- mod_poco64
+ ..\bin64\
+ obj64\$(Configuration)\
+ true
+ ..\bin64\
+ obj64\$(Configuration)\
+ false
+ mod_poco64d
+ mod_poco64
-
+
Disabled
.\include;..\Foundation\include;..\Net\include;..\Util\include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_WINDOWS;_USRDLL;ApacheHandlers_EXPORTS;%(PreprocessorDefinitions)
+ WIN32;_WIN64;_DEBUG;_WINDOWS;_USRDLL;ApacheHandlers_EXPORTS;%(PreprocessorDefinitions)
true
true
EnableFastChecks
@@ -58,7 +58,7 @@
true
true
true
-
+
Level3
ProgramDatabase
Default
@@ -76,7 +76,7 @@
MachineX64
-
+
Disabled
OnlyExplicitInline
@@ -84,16 +84,16 @@
Speed
true
.\include;..\Foundation\include;..\Net\include;..\Util\include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;_USRDLL;ApacheHandlers_EXPORTS;%(PreprocessorDefinitions)
+ WIN32;_WIN64;NDEBUG;_WINDOWS;_USRDLL;ApacheHandlers_EXPORTS;%(PreprocessorDefinitions)
true
MultiThreadedDLL
false
true
true
true
-
+
Level3
-
+
Default
%(DisableSpecificWarnings)
@@ -111,23 +111,23 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/CppUnit/WinTestRunner/src/ActiveTest.h b/CppUnit/WinTestRunner/src/ActiveTest.h
index 232747a9c..bf9df5e7d 100644
--- a/CppUnit/WinTestRunner/src/ActiveTest.h
+++ b/CppUnit/WinTestRunner/src/ActiveTest.h
@@ -38,16 +38,16 @@ public:
ActiveTest(Test* test);
~ActiveTest();
- void run(TestResult* result);
+ void run(TestResult* result);
protected:
- HANDLE _threadHandle;
- CEvent _runCompleted;
- TestResult* _currentTestResult;
-
- void run ();
- void setTestResult(TestResult* result);
- static UINT threadFunction(LPVOID thisInstance);
+ HANDLE _threadHandle;
+ CEvent _runCompleted;
+ TestResult* _currentTestResult;
+
+ void run ();
+ void setTestResult(TestResult* result);
+ static UINT threadFunction(LPVOID thisInstance);
};
diff --git a/Crypto/testsuite/TestSuite_x64_vs100.vcxproj b/Crypto/testsuite/TestSuite_x64_vs100.vcxproj
index 9b7eadef4..32bde0615 100644
--- a/Crypto/testsuite/TestSuite_x64_vs100.vcxproj
+++ b/Crypto/testsuite/TestSuite_x64_vs100.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -32,90 +32,92 @@
TestSuite
Win32Proj
-
-
+
+
Application
Dynamic
MultiByte
-
+
Application
Dynamic
MultiByte
-
+
Application
Static
MultiByte
-
+
Application
Static
MultiByte
-
+
Application
Dynamic
MultiByte
-
+
Application
Dynamic
MultiByte
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
<_ProjectFileVersion>10.0.40219.1
- bin64\
- obj64\$(Configuration)\
- true
- bin64\
- obj64\$(Configuration)\
- false
- bin64\static_mt\
- obj64\$(Configuration)\
- true
- bin64\static_mt\
- obj64\$(Configuration)\
- false
- bin64\static_md\
- obj64\$(Configuration)\
- true
- bin64\static_md\
- obj64\$(Configuration)\
- false
- TestSuited
- TestSuited
- TestSuited
- TestSuite
- TestSuite
- TestSuite
+ bin64\
+ obj64\$(Configuration)\
+ true
+ bin64\
+ obj64\$(Configuration)\
+ false
+ bin64\static_mt\
+ obj64\$(Configuration)\
+ true
+ bin64\static_mt\
+ obj64\$(Configuration)\
+ false
+ bin64\static_md\
+ obj64\$(Configuration)\
+ true
+ bin64\static_md\
+ obj64\$(Configuration)\
+ false
+ TestSuited
+ TestSuited
+ TestSuited
+ TestSuite
+ TestSuite
+ TestSuite
+ C:\openssl\include;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;
+ C:\openssl\lib;$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;
-
+
Disabled
..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions)
+ WIN32;_WIN64;_DEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions)
true
true
EnableFastChecks
@@ -124,7 +126,7 @@
true
true
true
-
+
Level3
ProgramDatabase
Default
@@ -141,7 +143,7 @@
MachineX64
-
+
Disabled
OnlyExplicitInline
@@ -149,16 +151,16 @@
Speed
true
..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions)
+ WIN32;_WIN64;NDEBUG;_WINDOWS;WINVER=0x0600;%(PreprocessorDefinitions)
true
MultiThreadedDLL
false
true
true
true
-
+
Level3
-
+
Default
%(DisableSpecificWarnings)
@@ -173,11 +175,11 @@
MachineX64
-
+
Disabled
..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions)
+ WIN32;_WIN64;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions)
true
true
EnableFastChecks
@@ -186,7 +188,7 @@
true
true
true
-
+
Level3
ProgramDatabase
Default
@@ -204,7 +206,7 @@
MachineX64
-
+
Disabled
OnlyExplicitInline
@@ -212,16 +214,16 @@
Speed
true
..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions)
+ WIN32;_WIN64;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions)
true
MultiThreaded
false
true
true
true
-
+
Level3
-
+
Default
%(DisableSpecificWarnings)
@@ -237,11 +239,11 @@
MachineX64
-
+
Disabled
..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions)
+ WIN32;_WIN64;_DEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions)
true
true
EnableFastChecks
@@ -250,7 +252,7 @@
true
true
true
-
+
Level3
ProgramDatabase
Default
@@ -267,7 +269,7 @@
MachineX64
-
+
Disabled
OnlyExplicitInline
@@ -275,16 +277,16 @@
Speed
true
..\include;..\..\CppUnit\include;..\..\CppUnit\WinTestRunner\include;..\..\Foundation\include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions)
+ WIN32;_WIN64;NDEBUG;_WINDOWS;WINVER=0x0600;POCO_STATIC;%(PreprocessorDefinitions)
true
MultiThreadedDLL
false
true
true
true
-
+
Level3
-
+
Default
%(DisableSpecificWarnings)
@@ -300,18 +302,18 @@
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/Data/MySQL/include/Poco/Data/MySQL/Connector.h b/Data/MySQL/include/Poco/Data/MySQL/Connector.h
index 47c8dd7c7..a9986e531 100644
--- a/Data/MySQL/include/Poco/Data/MySQL/Connector.h
+++ b/Data/MySQL/include/Poco/Data/MySQL/Connector.h
@@ -44,6 +44,12 @@
#include "Poco/Data/Connector.h"
+// Note: to avoid static (de)initialization problems,
+// during connector automatic (un)registration, it is
+// best to have this as a macro.
+#define POCO_DATA_MYSQL_CONNECTOR_NAME "mysql"
+
+
namespace Poco {
namespace Data {
namespace MySQL {
@@ -80,4 +86,55 @@ public:
} } } // namespace Poco::Data::MySQL
+//
+// Automatic Connector registration
+//
+
+struct MySQL_API MySQLConnectorRegistrator
+ /// Connector registering class.
+ /// A global instance of this class is instantiated
+ /// with sole purpose to automatically register the
+ /// MySQL connector with central Poco Data registry.
+{
+ MySQLConnectorRegistrator()
+ /// Calls Poco::Data::MySQL::registerConnector();
+ {
+ Poco::Data::MySQL::Connector::registerConnector();
+ }
+
+ ~MySQLConnectorRegistrator()
+ /// Calls Poco::Data::MySQL::unregisterConnector();
+ {
+ Poco::Data::MySQL::Connector::unregisterConnector();
+ }
+};
+
+
+#if !defined(POCO_NO_AUTOMATIC_LIB_INIT)
+ #if defined(POCO_OS_FAMILY_WINDOWS)
+ extern "C" const struct MySQL_API MySQLConnectorRegistrator pocoMySQLConnectorRegistrator;
+ #if defined(MySQL_EXPORTS)
+ #if defined(_WIN64)
+ #define POCO_DATA_MYSQL_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:"#s))
+ #elif defined(_WIN32)
+ #define POCO_DATA_MYSQL_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:_"#s))
+ #endif
+ #else // !MySQL_EXPORTS
+ #if defined(_WIN64)
+ #define POCO_DATA_MYSQL_FORCE_SYMBOL(s) __pragma(comment (linker, "/include:"#s))
+ #elif defined(_WIN32)
+ #define POCO_DATA_MYSQL_FORCE_SYMBOL(s) __pragma(comment (linker, "/include:_"#s))
+ #endif
+ #endif // MySQL_EXPORTS
+ #else // !POCO_OS_FAMILY_WINDOWS
+ #define POCO_DATA_MYSQL_FORCE_SYMBOL(s) extern "C" const struct MySQLConnectorRegistrator s;
+ #endif // POCO_OS_FAMILY_WINDOWS
+ POCO_DATA_MYSQL_FORCE_SYMBOL(pocoMySQLConnectorRegistrator)
+#endif // POCO_NO_AUTOMATIC_LIB_INIT
+
+//
+// End automatic Connector registration
+//
+
+
#endif // Data_MySQL_Connector_INCLUDED
diff --git a/Data/MySQL/include/Poco/Data/MySQL/SessionImpl.h b/Data/MySQL/include/Poco/Data/MySQL/SessionImpl.h
index 1e890db1a..47fb2ced7 100644
--- a/Data/MySQL/include/Poco/Data/MySQL/SessionImpl.h
+++ b/Data/MySQL/include/Poco/Data/MySQL/SessionImpl.h
@@ -141,7 +141,7 @@ public:
SessionHandle& handle();
// Get handle
- const std::string& connectorName();
+ const std::string& connectorName() const;
/// Returns the name of the connector.
private:
@@ -208,7 +208,7 @@ inline SessionHandle& SessionImpl::handle()
}
-inline const std::string& SessionImpl::connectorName()
+inline const std::string& SessionImpl::connectorName() const
{
return _connector;
}
diff --git a/Data/MySQL/src/Connector.cpp b/Data/MySQL/src/Connector.cpp
index 9739518d6..6e21ef2fd 100644
--- a/Data/MySQL/src/Connector.cpp
+++ b/Data/MySQL/src/Connector.cpp
@@ -38,16 +38,18 @@
#include "Poco/Data/MySQL/SessionImpl.h"
#include "Poco/Data/SessionFactory.h"
#include "Poco/Exception.h"
-
#include
+const MySQLConnectorRegistrator pocoMySQLConnectorRegistrator;
+
+
namespace Poco {
namespace Data {
namespace MySQL {
-std::string Connector::KEY("mysql");
+std::string Connector::KEY(POCO_DATA_MYSQL_CONNECTOR_NAME);
Connector::Connector()
@@ -61,7 +63,8 @@ Connector::~Connector()
const std::string& Connector::name() const
{
- return KEY;
+ static const std::string n(POCO_DATA_MYSQL_CONNECTOR_NAME);
+ return n;
}
Poco::AutoPtr Connector::createSession(const std::string& connectionString,
@@ -84,7 +87,7 @@ void Connector::registerConnector()
void Connector::unregisterConnector()
{
- Poco::Data::SessionFactory::instance().remove(KEY);
+ Poco::Data::SessionFactory::instance().remove(POCO_DATA_MYSQL_CONNECTOR_NAME);
mysql_library_end();
}
diff --git a/Data/ODBC/include/Poco/Data/ODBC/Connector.h b/Data/ODBC/include/Poco/Data/ODBC/Connector.h
index d9c3fb11f..ab5f887ef 100644
--- a/Data/ODBC/include/Poco/Data/ODBC/Connector.h
+++ b/Data/ODBC/include/Poco/Data/ODBC/Connector.h
@@ -44,6 +44,12 @@
#include "Poco/Data/Connector.h"
+// Note: to avoid static (de)initialization problems,
+// during connector automatic (un)registration, it is
+// best to have this as a macro.
+#define POCO_DATA_ODBC_CONNECTOR_NAME "odbc"
+
+
namespace Poco {
namespace Data {
namespace ODBC {
@@ -83,11 +89,63 @@ public:
inline const std::string& Connector::name() const
{
- return KEY;
+ static const std::string n(POCO_DATA_ODBC_CONNECTOR_NAME);
+ return n;
}
} } } // namespace Poco::Data::ODBC
+//
+// Automatic Connector registration
+//
+
+struct ODBC_API ODBCConnectorRegistrator
+ /// Connector registering class.
+ /// A global instance of this class is instantiated
+ /// with sole purpose to automatically register the
+ /// ODBC connector with central Poco Data registry.
+{
+ ODBCConnectorRegistrator()
+ /// Calls Poco::Data::ODBC::registerConnector();
+ {
+ Poco::Data::ODBC::Connector::registerConnector();
+ }
+
+ ~ODBCConnectorRegistrator()
+ /// Calls Poco::Data::ODBC::unregisterConnector();
+ {
+ Poco::Data::ODBC::Connector::unregisterConnector();
+ }
+};
+
+
+#if !defined(POCO_NO_AUTOMATIC_LIB_INIT)
+ #if defined(POCO_OS_FAMILY_WINDOWS)
+ extern "C" const struct ODBC_API ODBCConnectorRegistrator pocoODBCConnectorRegistrator;
+ #if defined(ODBC_EXPORTS)
+ #if defined(_WIN64)
+ #define POCO_DATA_ODBC_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:"#s))
+ #elif defined(_WIN32)
+ #define POCO_DATA_ODBC_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:_"#s))
+ #endif
+ #else // !ODBC_EXPORTS
+ #if defined(_WIN64)
+ #define POCO_DATA_ODBC_FORCE_SYMBOL(s) __pragma(comment (linker, "/include:"#s))
+ #elif defined(_WIN32)
+ #define POCO_DATA_ODBC_FORCE_SYMBOL(s) __pragma(comment (linker, "/include:_"#s))
+ #endif
+ #endif // ODBC_EXPORTS
+ #else // !POCO_OS_FAMILY_WINDOWS
+ #define POCO_DATA_ODBC_FORCE_SYMBOL(s) extern "C" const struct ODBCConnectorRegistrator s;
+ #endif // POCO_OS_FAMILY_WINDOWS
+ POCO_DATA_ODBC_FORCE_SYMBOL(pocoODBCConnectorRegistrator)
+#endif // POCO_NO_AUTOMATIC_LIB_INIT
+
+//
+// End automatic Connector registration
+//
+
+
#endif // Data_ODBC_Connector_INCLUDED
diff --git a/Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h b/Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h
index 965ac6a5a..0fb2a38ec 100644
--- a/Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h
+++ b/Data/ODBC/include/Poco/Data/ODBC/SessionImpl.h
@@ -122,7 +122,7 @@ public:
bool isTransaction();
/// Returns true iff a transaction is in progress.
- const std::string& connectorName();
+ const std::string& connectorName() const;
/// Returns the name of the connector.
bool canTransact();
@@ -263,7 +263,7 @@ inline bool SessionImpl::isAutoExtract(const std::string& name)
}
-inline const std::string& SessionImpl::connectorName()
+inline const std::string& SessionImpl::connectorName() const
{
return _connector;
}
diff --git a/Data/ODBC/src/Connector.cpp b/Data/ODBC/src/Connector.cpp
index b6d6b9ac3..28139fe58 100644
--- a/Data/ODBC/src/Connector.cpp
+++ b/Data/ODBC/src/Connector.cpp
@@ -39,12 +39,15 @@
#include "Poco/Data/SessionFactory.h"
+const ODBCConnectorRegistrator pocoODBCConnectorRegistrator;
+
+
namespace Poco {
namespace Data {
namespace ODBC {
-const std::string Connector::KEY("odbc");
+const std::string Connector::KEY(POCO_DATA_ODBC_CONNECTOR_NAME);
Connector::Connector()
@@ -72,7 +75,7 @@ void Connector::registerConnector()
void Connector::unregisterConnector()
{
- Poco::Data::SessionFactory::instance().remove(KEY);
+ Poco::Data::SessionFactory::instance().remove(POCO_DATA_ODBC_CONNECTOR_NAME);
}
diff --git a/Data/ODBC/testsuite/src/ODBCTest.cpp b/Data/ODBC/testsuite/src/ODBCTest.cpp
index 0f4cbe7ab..1ff616f71 100644
--- a/Data/ODBC/testsuite/src/ODBCTest.cpp
+++ b/Data/ODBC/testsuite/src/ODBCTest.cpp
@@ -1313,7 +1313,6 @@ ODBCTest::SessionPtr ODBCTest::init(const std::string& driver,
Utility::drivers(_drivers);
if (!canConnect(driver, dsn, uid, pwd, dbConnString, db)) return 0;
- Poco::Data::ODBC::Connector::registerConnector();
try
{
std::cout << "Conecting to [" << dbConnString << ']' << std::endl;
diff --git a/Data/SQLite/SQLite_vs100.vcxproj b/Data/SQLite/SQLite_vs100.vcxproj
index 64a095484..c7d8b1cb8 100644
--- a/Data/SQLite/SQLite_vs100.vcxproj
+++ b/Data/SQLite/SQLite_vs100.vcxproj
@@ -1,4 +1,4 @@
-
+
@@ -32,76 +32,76 @@
SQLite
Win32Proj
-
-
+
+
StaticLibrary
MultiByte
-
+
StaticLibrary
MultiByte
-
+
StaticLibrary
MultiByte
-
+
StaticLibrary
MultiByte
-
+
DynamicLibrary
MultiByte
-
+
DynamicLibrary
MultiByte
-
-
-
-
+
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
<_ProjectFileVersion>10.0.40219.1
- ..\..\bin\
- obj\$(Configuration)\
- true
- ..\..\bin\
- obj\$(Configuration)\
- false
- ..\..\lib\
- obj\$(Configuration)\
- ..\..\lib\
- obj\$(Configuration)\
- ..\..\lib\
- obj\$(Configuration)\
- ..\..\lib\
- obj\$(Configuration)\
- PocoDataSQLited
- PocoDataSQLitemdd
- PocoDataSQLitemtd
- PocoDataSQLite
- PocoDataSQLitemd
- PocoDataSQLitemt
+ ..\..\bin\
+ obj\$(Configuration)\
+ true
+ ..\..\bin\
+ obj\$(Configuration)\
+ false
+ ..\..\lib\
+ obj\$(Configuration)\
+ ..\..\lib\
+ obj\$(Configuration)\
+ ..\..\lib\
+ obj\$(Configuration)\
+ ..\..\lib\
+ obj\$(Configuration)\
+ PocoDataSQLited
+ PocoDataSQLitemdd
+ PocoDataSQLitemtd
+ PocoDataSQLite
+ PocoDataSQLitemd
+ PocoDataSQLitemt
-
+
Disabled
.\include;..\..\Foundation\include;..\..\Data\include;%(AdditionalIncludeDirectories)
@@ -114,7 +114,7 @@
true
true
true
-
+
Level3
EditAndContinue
Default
@@ -132,7 +132,7 @@
MachineX86
-
+
Disabled
OnlyExplicitInline
@@ -147,9 +147,9 @@
true
true
true
-
+
Level3
-
+
Default
4996;4244;4018;%(DisableSpecificWarnings)
@@ -166,7 +166,7 @@
MachineX86
-
+
Disabled
.\include;..\..\Foundation\include;..\..\Data\include;%(AdditionalIncludeDirectories)
@@ -179,7 +179,7 @@
true
true
true
-
+
..\..\lib\PocoDataSQLitemtd.pdb
Level3
EditAndContinue
@@ -190,7 +190,7 @@
..\..\lib\PocoDataSQLitemtd.lib
-
+
Disabled
OnlyExplicitInline
@@ -205,9 +205,9 @@
true
true
true
-
+
Level3
-
+
Default
4996;4244;4018;%(DisableSpecificWarnings)
@@ -215,7 +215,7 @@
..\..\lib\PocoDataSQLitemt.lib
-
+
Disabled
.\include;..\..\Foundation\include;..\..\Data\include;%(AdditionalIncludeDirectories)
@@ -228,7 +228,7 @@
true
true
true
-
+
..\..\lib\PocoDataSQLitemdd.pdb
Level3
EditAndContinue
@@ -239,7 +239,7 @@
..\..\lib\PocoDataSQLitemdd.lib
-
+
Disabled
OnlyExplicitInline
@@ -254,10 +254,10 @@
true
true
true
-
+
..\..\lib\PocoDataSQLitemd.pdb
Level3
-
+
Default
4996;4244;4018;%(DisableSpecificWarnings)
@@ -267,26 +267,26 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
\ No newline at end of file
diff --git a/Data/SQLite/include/Poco/Data/SQLite/Connector.h b/Data/SQLite/include/Poco/Data/SQLite/Connector.h
index eefe6961f..f509acbdf 100644
--- a/Data/SQLite/include/Poco/Data/SQLite/Connector.h
+++ b/Data/SQLite/include/Poco/Data/SQLite/Connector.h
@@ -44,6 +44,12 @@
#include "Poco/Data/Connector.h"
+// Note: to avoid static (de)initialization problems,
+// during connector automatic (un)registration, it is
+// best to have this as a macro.
+#define POCO_DATA_SQLITE_CONNECTOR_NAME "sqlite"
+
+
namespace Poco {
namespace Data {
namespace SQLite {
@@ -91,11 +97,62 @@ public:
///
inline const std::string& Connector::name() const
{
- return KEY;
+ static const std::string n(POCO_DATA_SQLITE_CONNECTOR_NAME);
+ return n;
}
} } } // namespace Poco::Data::SQLite
+//
+// Automatic Connector registration
+//
+
+struct SQLite_API SQLiteConnectorRegistrator
+ /// Connector registering class.
+ /// A global instance of this class is instantiated
+ /// with sole purpose to automatically register the
+ /// SQLite connector with central Poco Data registry.
+{
+ SQLiteConnectorRegistrator()
+ /// Calls Poco::Data::SQLite::registerConnector();
+ {
+ Poco::Data::SQLite::Connector::registerConnector();
+ }
+
+ ~SQLiteConnectorRegistrator()
+ /// Calls Poco::Data::SQLite::unregisterConnector();
+ {
+ Poco::Data::SQLite::Connector::unregisterConnector();
+ }
+};
+
+
+#if !defined(POCO_NO_AUTOMATIC_LIB_INIT)
+ #if defined(POCO_OS_FAMILY_WINDOWS)
+ extern "C" const struct SQLite_API SQLiteConnectorRegistrator pocoSQLiteConnectorRegistrator;
+ #if defined(SQLite_EXPORTS)
+ #if defined(_WIN64)
+ #define POCO_DATA_SQLITE_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:"#s))
+ #elif defined(_WIN32)
+ #define POCO_DATA_SQLITE_FORCE_SYMBOL(s) __pragma(comment (linker, "/export:_"#s))
+ #endif
+ #else // !SQLite_EXPORTS
+ #if defined(_WIN64)
+ #define POCO_DATA_SQLITE_FORCE_SYMBOL(s) __pragma(comment (linker, "/include:"#s))
+ #elif defined(_WIN32)
+ #define POCO_DATA_SQLITE_FORCE_SYMBOL(s) __pragma(comment (linker, "/include:_"#s))
+ #endif
+ #endif // SQLite_EXPORTS
+ #else // !POCO_OS_FAMILY_WINDOWS
+ #define POCO_DATA_SQLITE_FORCE_SYMBOL(s) extern "C" const struct SQLiteConnectorRegistrator s;
+ #endif // POCO_OS_FAMILY_WINDOWS
+ POCO_DATA_SQLITE_FORCE_SYMBOL(pocoSQLiteConnectorRegistrator)
+#endif // POCO_NO_AUTOMATIC_LIB_INIT
+
+//
+// End automatic Connector registration
+//
+
#endif // Data_SQLite_Connector_INCLUDED
diff --git a/Data/SQLite/include/Poco/Data/SQLite/SQLite.h b/Data/SQLite/include/Poco/Data/SQLite/SQLite.h
index ea013103a..15ea80b9b 100644
--- a/Data/SQLite/include/Poco/Data/SQLite/SQLite.h
+++ b/Data/SQLite/include/Poco/Data/SQLite/SQLite.h
@@ -84,7 +84,7 @@
//
// Thread safety mode defaults to "serialized".
// See http://www.sqlite.org/threadsafe.html for details.
-// Threading mode significantly affects performance
+// Threading mode may significantly affect performance
// (see TestSuite::benchmarkThreadModesTiming)
//
#ifndef SQLITE_THREADSAFE
diff --git a/Data/SQLite/include/Poco/Data/SQLite/SessionImpl.h b/Data/SQLite/include/Poco/Data/SQLite/SessionImpl.h
index 912c74c57..dd758f583 100644
--- a/Data/SQLite/include/Poco/Data/SQLite/SessionImpl.h
+++ b/Data/SQLite/include/Poco/Data/SQLite/SessionImpl.h
@@ -41,6 +41,7 @@
#include "Poco/Data/SQLite/SQLite.h"
+#include "Poco/Data/SQLite/Connector.h"
#include "Poco/Data/SQLite/Binder.h"
#include "Poco/Data/AbstractSessionImpl.h"
#include "Poco/SharedPtr.h"
@@ -51,6 +52,9 @@ struct sqlite3_stmt;
namespace Poco {
+
+class Mutex;
+
namespace Data {
namespace SQLite {
@@ -124,17 +128,22 @@ public:
/// Returns true iff the transaction isolation level corresponds
/// to the supplied bitmask.
- const std::string& connectorName();
+ void autoCommit(const std::string&, bool val);
+ /// Sets autocommit property for the session.
+
+ bool isAutoCommit(const std::string& name="");
+ /// Returns autocommit property value.
+
+ const std::string& connectorName() const;
/// Returns the name of the connector.
private:
-
std::string _connector;
sqlite3* _pDB;
bool _connected;
bool _isTransaction;
int _timeout;
-
+ Mutex _mutex;
static const std::string DEFERRED_BEGIN_TRANSACTION;
static const std::string COMMIT_TRANSACTION;
static const std::string ABORT_TRANSACTION;
@@ -156,7 +165,7 @@ inline bool SessionImpl::isTransaction()
}
-inline const std::string& SessionImpl::connectorName()
+inline const std::string& SessionImpl::connectorName() const
{
return _connector;
}
diff --git a/Data/SQLite/include/Poco/Data/SQLite/Utility.h b/Data/SQLite/include/Poco/Data/SQLite/Utility.h
index 14990f0d4..a274c8c67 100644
--- a/Data/SQLite/include/Poco/Data/SQLite/Utility.h
+++ b/Data/SQLite/include/Poco/Data/SQLite/Utility.h
@@ -42,7 +42,9 @@
#include "Poco/Data/SQLite/SQLite.h"
#include "Poco/Data/MetaColumn.h"
+#include "Poco/Data/Session.h"
#include "Poco/Mutex.h"
+#include "Poco/Types.h"
#include