Database pb: there was not enough remaining storage space...

694 views
Skip to first unread message

fvisticot

unread,
Feb 22, 2010, 6:00:04 PM2/22/10
to Chromium HTML5
I'm creating a very simple db (see code)

When inserting the tuples i have the following error:
there was not enough remaining storage space, or the storage quota was
reached and the user declined to allow more space (Code 4)

My questions:
1. how to list the database managed by the web navigator ?
2. Where are stored the databases ?
3. How to remove a database ?

The code:

function initDb() {
try {
if (!window.openDatabase) {
} else {
shortName = 'transactions5';
version = '1.0';
displayName = 'Transactions5';
maxSize = 2000000; // in bytes
db = openDatabase(shortName, version, displayName, maxSize);
}
} catch(e) {
if (e == INVALID_STATE_ERR) {
console.log("Invalid database version.");
} else {
alert("Unknown error "+e+".");
}
}
return db;
}

function createTables(db) {
db.transaction( function (transaction) {
transaction.executeSql('CREATE TABLE IF NOT EXISTS user(id INT NOT
NULL PRIMARY KEY, firstName CHAR(35), lastName CHAR(35), age INT,
address CHAR(40), email CHAR(20), phone CHAR(15));');
});
}

function createUsers(users) {
db.transaction( function (transaction) {
while (users.length > 0) {
user = users.pop();
console.log("User: " + user.firstName + " " + user.lastName, + " "
+ user.age + " " + user.address + " " + user.email + " " +
user.phone);
transaction.executeSql('INSERT INTO user(firstName, lastName, age,
address, email, phone) values (?, ?, ?, ?, ?, ?);', [user.firstName,
user.lastName, user.age, user.address, user.email, user.phone], null,
errorHandler);
}
endTime = new Date().getTime();
alert(endTime-startTime);
});
}


Remy Sharp

unread,
Feb 22, 2010, 6:26:03 PM2/22/10
to Chromium HTML5
On 22 Feb 2010, at 23:00, fvisticot wrote:

> My questions:
> 1. how to list the database managed by the web navigator ?
> 2. Where are stored the databases ?
> 3. How to remove a database ?

My understanding of the Web SQL Database spec, is that the answers you're looking for are: 1) you can't, 2) *somewhere*, but it depends on the browser - ie. you can't get it, 3) and you can't.

Or certainly that's what I got from the specifications!

Remy Sharp

fvisticot

unread,
Feb 23, 2010, 1:17:03 AM2/23/10
to Chromium HTML5
A solution should exist...
I really don't know how many db has been installed in this
browser...and it takes a lot of disk space !!!

Any idea regarding my error message ?

Dumitru Daniliuc

unread,
Feb 26, 2010, 7:09:09 PM2/26/10
to fvisticot, Chromium HTML5
> > 1. how to list the database managed by the web navigator ?

not sure who this "web navigator" is.


> > 2. Where are stored the databases ?

it depends on your OS. on windows (vista/7), all DBs are in C:\Users\<your_username>\AppData\Local\Chromium\UserData\Default\databases (replace Chromium with Google\Chrome, if you use an official Google Chrome build). on linux they're in $HOME/.config/chromium/Default/databases/, and on mac they're in $HOME/Library/Application Support/Chromium/Default/databases/.


> > 3. How to remove a database ?

if you use a fairly recent Chromium build (not older than a week or so), then you can go to "wrench menu" --> Options --> Under the hood --> (find the window that displays all cookies). when you click on a node, it should show you all cookies, databases and local storages used by that origin. then you can select a database, and hit Delete to delete it.

otherwise, you can go to the "databases" directory and manually delete files in there (all files in there are sqlite databases). before you do that though, i'd recommend using a sqlite tool to open each file and see what's in there and make sure you no longer need it. you can also open Databases.db, go to the 'Databases' table and remove the records for the files you just deleted (delete the rows with ID = file name of the deleted file), but it's not mandatory.

hope that helps.

dumi

Reply all
Reply to author
Forward
0 new messages