public DbUtils.Core.Api.IDbServerConnection[] RestoreSessions(SqliteConnection connection)
        {
            InitializeStateDb(connection);

            IList <IDbServerConnection> sessions = new List <IDbServerConnection> ();

            using (SqliteCommand cmd = connection.CreateCommand()) {
                cmd.CommandText = "select * from dbstate";
                using (SqliteDataReader reader = cmd.ExecuteReader()) {
                    while (reader.Read())
                    {
                        string providerName = reader.GetString(reader.GetOrdinal("provider"));
                        string state        = reader.GetString(reader.GetOrdinal("state"));

                        try {
                            Type providerType = Type.GetType(providerName);
                            ISessionStateProvider sessionProvider = (ISessionStateProvider)providerType.GetConstructor(new Type[] {}).Invoke(new object[] {});
                            IDbServerConnection   session         = sessionProvider.restoreSessionFromState(state);
                            sessions.Add(session);
                        } catch (Exception e) {
                            // todo, log error and continue
                            throw e;
                        }
                    }
                }
            }

            return(sessions.ToArray());
        }