Adobe Air SQLError: ‘Error #3119: Database file is currently locked.’, details:’null’, operation:’execute’

For the longest time I was having issues with this Adobe Air Error and its description, the main issue is that the “details” for this error are “null”. We do get the description that the database is locked but no details on file name where the error occur or line number.

If you do a search in the Adobe documentation you will get a pretty blank line after the error:

3119 Database file is currently locked.

To solve the issue once and for all what the error means is that you have a connection open to make changes to the database and you have opened a new connection to make more changes to the database. So there are 2 solutions

1. Use the first connection to make your second updates
2. Close the first connection and then you can use the new connection

Continue reading Adobe Air SQLError: ‘Error #3119: Database file is currently locked.’, details:’null’, operation:’execute’

Adobe Air CreateDirectory common error

If you need to create a directory from Air and you dont know how, mostlikely you will use the Adobe Air Documentation and use something as the following:

[js]
var directory = air.File.documentsDirectory;
directory = directory.resolvePath(“AIR Test”);

air.File.createDirectory(directory);
air.trace(directory.exists); // true
[/js]

it all looks nice and makes sense but in the real world it wont work, you would get an error like this:

Type Error : Value undefined ( result of expression air.File.createDirectory ) is not object.
# of your code error.

The problem with this approach is that the createDirectory method doesnt take any parameters, if you try to pass values directly to the method you will get this error:

Argument Error : Error #1063: Argument count mismatch on flash.filesystem::File/createDirectory(). Expected 0, got 1.

Once i was able to get this error I realized that the docs were wrong, or at least on this specific section. So looking at a different sample I figured out this works:

[js]
var directory = air.File.documentsDirectory;
directory = directory.resolvePath(“Air Test”);
directory.createDirectory();//no parameters necessary, Air knows where we need the new directory.
[/js/]

By first “asking” Air if the directory exists then Air knows where to create the new Directory rather than passing the property directly to the method.

This applies to Adobe Air SDK 3.0 and using Javascript

Tags: , , ,