Avg. Rating 1.0

Problem

When a SQL Lite connection is opened using openasync, the connection is often getting lost while debugging.

Solution

Declare the SQLConnection as Static.

Detailed explanation

When opening a database connection to SQL Lite using AIR, the connection is often getting disconnected and we have to check for the 'connected' value before executing any DB operations. This often occurs while debugging the application.

The problem can be resolved by declaring the DB connection as 'Public Static var' instead of 'Public var'.

public static var dbConn:SQLConnection = new SQLConnection;


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes