03-24-2011 07:38 AM
I'm getting a very strange error that only happens when I try to run the release build of my application on the simulator. When I run the debug version everything is fine. I can access, read and write the database without a problem. But when I try to run a release build, I keep getting error 3122 (
03-24-2011 07:58 AM
You can't write to any of the files or folders installed with your application. If you have a database (or any other file) which you need to change after installation, you have to copy it from the app: folder (File.applicationDirectory) to the app-storage: folder (File.applicationStorageDirectory), generally the first time your app launches.
03-24-2011 08:07 AM
I tried with the userDirectory, the documents directory and the appStorage directory. None of them work with the release build. And after I tried to run a release build, the debug build also fails until I change the name of the file to be created.
When I change the file name the debug version starts working again. But even with a different file name the release build still fails to run.
03-24-2011 08:17 AM
The database is created when the application is run and as I've said in another reply I've tried with most of the file locations that are available and should be writable.
03-24-2011 08:27 AM
It's possible there's a bug involving where those directories point on a release build versus a debug build, though I think that's unlikely.
Can you post a snippet showing the code where you determine the location of the database, and initially open it? And possibly the line which is raising the 3122 error?
Alternatively, reduce the problem to the smallest-possible example which demonstrates the problem, so others can try running it to reproduce the error.
Or, at least add in a trace() call and write out the .nativePath component of the database's File object just as you create it.
By the way, by "created when the application is run" do you mean created from scratch, by doing a SQLConnection.open() on it and then issuing CREATE TABLE statements etc? Can you confirm that no database file exists in that location prior to the open() call? (You may want to uninstall the app fully before installing, to test this, rather than just installing over whatever version was there before.)
08-23-2011 03:03 AM
I am also facing the same problem after signed the bar file, Before signed the bar its working fine after signing the bar I am unable to modify the database but can view the data, even I installed the new signing keys the problem is not solved.Please kindly help me. I am waiting for your reply.
08-23-2011 07:02 AM
I got the problem, for new signing keys the application id is changing in the bar file, so the db file is read only for the new version of the app. Is it correct? If yes how to update the applications? I alrady facing this problem please any one help me...
02-18-2013 07:24 PM
Old thread. Started to get this when upgraded to 3.1 of the SDK.
SQLError: 'Error #3122: Attempt to write a readonly database.', details:'attempt to write a readonly database', operation:'execute', detailID:'2206' at flash.data::SQLStatement/internalExecute() at flash.data::SQLStatement/execute()