aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/SPMySQLFramework/Source/SPMySQLConstants.h
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-05-08 01:03:31 +0000
committerrowanbeentje <rowan@beent.je>2012-05-08 01:03:31 +0000
commitcb29bcb923804e844411fb4872f55993bf29ee91 (patch)
treefba6f3404da187452bd3c04555cdf5f36f4e92e3 /Frameworks/SPMySQLFramework/Source/SPMySQLConstants.h
parent725df83787f10b0f6ff84c93de260a73577b1844 (diff)
downloadsequelpro-cb29bcb923804e844411fb4872f55993bf29ee91.tar.gz
sequelpro-cb29bcb923804e844411fb4872f55993bf29ee91.tar.bz2
sequelpro-cb29bcb923804e844411fb4872f55993bf29ee91.zip
Rework connection loss handling in SPMySQL, particularly to improve background loss of connections:
- Attempt to fix a condition causing a reconnection loop by fixing the order of connection state check and a query variable - If a connection is lost in the background, only attempt a single reconnect instead of requiring user intervention at once - Add a new connection state to handle background disconnects - If the connection has been lost in the background but is about to be used, reconnect it automatically (informing the user of loss if appropriate) - Don't attempt background reconnections if the connection has not been used for some time (Also update localisable strings, and tweak navigator controller connection usage)
Diffstat (limited to 'Frameworks/SPMySQLFramework/Source/SPMySQLConstants.h')
-rw-r--r--Frameworks/SPMySQLFramework/Source/SPMySQLConstants.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/Frameworks/SPMySQLFramework/Source/SPMySQLConstants.h b/Frameworks/SPMySQLFramework/Source/SPMySQLConstants.h
index b1689569..7144d968 100644
--- a/Frameworks/SPMySQLFramework/Source/SPMySQLConstants.h
+++ b/Frameworks/SPMySQLFramework/Source/SPMySQLConstants.h
@@ -33,30 +33,31 @@
// Connection state
typedef enum {
- SPMySQLDisconnected = 0,
- SPMySQLConnecting = 1,
- SPMySQLConnected = 2,
- SPMySQLDisconnecting = 3
+ SPMySQLDisconnected = 0,
+ SPMySQLConnecting = 1,
+ SPMySQLConnected = 2,
+ SPMySQLConnectionLostInBackground = 3,
+ SPMySQLDisconnecting = 4
} SPMySQLConnectionState;
// Connection lock state
typedef enum {
- SPMySQLConnectionIdle = 0,
- SPMySQLConnectionBusy = 1
+ SPMySQLConnectionIdle = 0,
+ SPMySQLConnectionBusy = 1
} SPMySQLConnectionLockState;
// Decision on how to handle lost connections
// Connection check constants
typedef enum {
- SPMySQLConnectionLostDisconnect = 0,
- SPMySQLConnectionLostReconnect = 1
+ SPMySQLConnectionLostDisconnect = 0,
+ SPMySQLConnectionLostReconnect = 1
} SPMySQLConnectionLostDecision;
// Result set row types
typedef enum {
- SPMySQLResultRowAsDefault = 0,
- SPMySQLResultRowAsArray = 1,
- SPMySQLResultRowAsDictionary = 2
+ SPMySQLResultRowAsDefault = 0,
+ SPMySQLResultRowAsArray = 1,
+ SPMySQLResultRowAsDictionary = 2
} SPMySQLResultRowType;
// Result charset list
@@ -70,7 +71,7 @@ typedef struct {
// Query result types
typedef enum {
- SPMySQLResultAsResult = 0,
- SPMySQLResultAsFastStreamingResult = 1,
- SPMySQLResultAsLowMemStreamingResult = 2
+ SPMySQLResultAsResult = 0,
+ SPMySQLResultAsFastStreamingResult = 1,
+ SPMySQLResultAsLowMemStreamingResult = 2
} SPMySQLResultType;