Re: [sqlite] cannot commit - no transaction is active

2007-11-19 Thread Srebrenko Sehic
On Nov 19, 2007 9:15 AM, learning Sqlite3
<[EMAIL PROTECTED]> wrote:

> I use the function:
> apr_dbd_transaction_start(driver, pool, sql,
>);
> to start a transaction.
>
> But when I close this transaction with the function:
> apr_dbd_transaction_end(driver, pool, transaction);
>
> It always gives the error message:
>
> cannot commit - no transaction is active
>
> What is the reason?

This is Apache/APR wrapper API. I suggest you ask the appropriate
place instead of here.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Unicode

2007-07-30 Thread Srebrenko Sehic
On 7/30/07, wcmadness <[EMAIL PROTECTED]> wrote:

> I'm stuck on this.  I'm writing a data layer that potentially needs to handle
> diacritical (sp?) characters, such a French accented é characters or German
> umlauted characters (sp?).  It should be rare that I would run into
> something like this, but the data layer should handle it nevertheless.  For
> example, it would certainly be expected to handle something as simple as the
> word résumé or the name Réggé.
>
> I've tried quite a few things now, and I just can't get to a solid solution.
> The data gets stored to Sqlite, but when I try to select it, I have
> problems.  Here's a sample of the error I get from the Python shell trying
> to select data with accented characters:

This is probably not related to the SQLite library itself. You should
talk to the author(s) of the Python bindings and/or look at your own
code. I do a lot of coding in Perl (accessing SQLite via DBD::SQLite)
and have no problems with Latin-1 or Unicode.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Milliseconds

2007-07-12 Thread Srebrenko Sehic

On 7/12/07, Steinmaurer Thomas <[EMAIL PROTECTED]> wrote:

Hello,

is there a way to retrieve and store the millisecond part of a (current)
timestamp?


If you're on a Unix-like system, have a look at gettimeofday which returns:

struct timeval {
   longtv_sec; /* seconds since Jan. 1, 1970 */
   longtv_usec;/* and microseconds */
};

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: sqlite3_step returns different error codes depending on PRAGMA cache_size

2007-07-11 Thread Srebrenko Sehic

While the bulk INSERTs are being performed, I have a small shell
script that runs sqlite3 database.db "select count(*) from table" in
loop and sleeps 1 seconds between iterations.

Occasionally, sqlite3_step returns an error probably due to
concurrency issues. This is fine.

However, that puzzles me is that if PRAGMA cache_size = 0 is set on
dbh, return code of sqlite3_step is SQLITE_IOERR. If set to default,
2048, it is SQLITE_BUSY. If set to 128, it's a mix of those 2 codes.


After re-reading
http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError, I
think the behavior I'm seeing is correct.

Sorry for the noise.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] sqlite3_step returns different error codes depending on PRAGMA cache_size

2007-07-11 Thread Srebrenko Sehic

I have an application that does bulk INSERTS into a table. Simplified
pseudo code is below:

sqlite3_open(dbh);
sqlite3_prepare(stmt);

for (i=0; i < 10; i++) {
   sqlite3_bind(i);
   sqlite3_step(stmt);
   sqlite3_reset(stmt);
}

sqlite3_close(dbh);

While the bulk INSERTs are being performed, I have a small shell
script that runs sqlite3 database.db "select count(*) from table" in
loop and sleeps 1 seconds between iterations.

Occasionally, sqlite3_step returns an error probably due to
concurrency issues. This is fine.

However, that puzzles me is that if PRAGMA cache_size = 0 is set on
dbh, return code of sqlite3_step is SQLITE_IOERR. If set to default,
2048, it is SQLITE_BUSY. If set to 128, it's a mix of those 2 codes.

I'm running 3.4.0 on OpenBSD 4.1/i386.

Is this the intended behavior?

// ssehic

-
To unsubscribe, send email to [EMAIL PROTECTED]
-