Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-08-16 Thread Ian Hickson
On Wed, 12 Aug 2009, Aaron Boodman wrote: I also don't see what not having a callback buys. I'm not sure if you noticed, but I was suggesting that the callback be reentrant. So if you do this: var theResult = null; database.syncTransaction(function(tx) {   theResult =

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-08-12 Thread Ian Hickson
On Mon, 3 Aug 2009, Aaron Boodman wrote: The API was intentionally made more obviously synchronous to avoid having to make people use callbacks. Would making all transactions automatically rollback if not committed when the event loop spins be an acceptable substitute solution? A

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-08-12 Thread Aaron Boodman
On Wed, Aug 12, 2009 at 4:33 PM, Ian Hicksoni...@hixie.ch wrote: On Mon, 3 Aug 2009, Aaron Boodman wrote: The API was intentionally made more obviously synchronous to avoid having to make people use callbacks. Would making all transactions automatically rollback if not committed when

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-08-03 Thread Ian Hickson
On Mon, 27 Jul 2009, Aaron Boodman wrote: On the subject of the callbacks, you should note that only having the sync API in workers won't fix this. The callbacks are a natural result of the requirement to never leave transactions open. The current sync proposal's explicit commit/rollback

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-08-03 Thread Aaron Boodman
On Mon, Aug 3, 2009 at 3:36 AM, Ian Hicksoni...@hixie.ch wrote: On Mon, 27 Jul 2009, Aaron Boodman wrote: On the subject of the callbacks, you should note that only having the sync API in workers won't fix this. The callbacks are a natural result of the requirement to never leave

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Nikunj R. Mehta
On Jul 25, 2009, at 1:18 PM, Aaron Boodman wrote: On Fri, Jul 24, 2009 at 6:51 PM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: It appears that Database, SQLTransactionCallback, SQLTransactionErrorCallback, SQLVoidCallback, SQLTransaction, SQLStatementCallback, and SQLStatementErrorCallback

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Aaron Boodman
On Mon, Jul 27, 2009 at 11:55 AM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: On Jul 25, 2009, at 1:18 PM, Aaron Boodman wrote: On Fri, Jul 24, 2009 at 6:51 PM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: It appears that Database, SQLTransactionCallback, SQLTransactionErrorCallback,

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Maciej Stachowiak
On Jul 27, 2009, at 12:55 PM, Nikunj R. Mehta wrote: On Jul 25, 2009, at 1:18 PM, Aaron Boodman wrote: But using workers is a large burden: they are completely separate JavaScript environments that share nothing with the main web page. Having to use that for simpler use cases would be very

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Nikunj R. Mehta
On Jul 27, 2009, at 12:43 PM, Aaron Boodman wrote: On Mon, Jul 27, 2009 at 11:55 AM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: On Jul 25, 2009, at 1:18 PM, Aaron Boodman wrote: On Fri, Jul 24, 2009 at 6:51 PM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: There is a brand new

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Nikunj R. Mehta
On Jul 27, 2009, at 12:54 PM, Maciej Stachowiak wrote: On Jul 27, 2009, at 12:55 PM, Nikunj R. Mehta wrote: snip JavaScript actually lets you write a series of nested callbacks in a way that looks almost like straight-line code, by using function expressions:

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Maciej Stachowiak
On Jul 27, 2009, at 2:14 PM, Nikunj R. Mehta wrote: And mine did get awkward, very quickly. I found it really hard to keep myself sane through the development of asynchronous code that executes transactionally and involves multiple sql statements. My argument is that the program logic

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Jonas Sicking
On Mon, Jul 27, 2009 at 2:32 PM, Maciej Stachowiakm...@apple.com wrote: On Jul 27, 2009, at 2:14 PM, Nikunj R. Mehta wrote: And mine did get awkward, very quickly. I found it really hard to keep myself sane through the development of asynchronous code that executes transactionally and

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Nikunj R. Mehta
On Jul 27, 2009, at 7:45 PM, Jonas Sicking wrote: On Mon, Jul 27, 2009 at 2:32 PM, Maciej Stachowiakm...@apple.com wrote: On Jul 27, 2009, at 2:14 PM, Nikunj R. Mehta wrote: And mine did get awkward, very quickly. I found it really hard to keep myself sane through the development of

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-27 Thread Jonas Sicking
On Mon, Jul 27, 2009 at 8:07 PM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: On Jul 27, 2009, at 7:45 PM, Jonas Sicking wrote: On Mon, Jul 27, 2009 at 2:32 PM, Maciej Stachowiakm...@apple.com wrote: On Jul 27, 2009, at 2:14 PM, Nikunj R. Mehta wrote: And mine did get awkward, very

Re: [WebDatabase] Database interface (vs. DatabaseSync interface)

2009-07-25 Thread Aaron Boodman
On Fri, Jul 24, 2009 at 6:51 PM, Nikunj R. Mehtanikunj.me...@oracle.com wrote: It appears that Database, SQLTransactionCallback, SQLTransactionErrorCallback, SQLVoidCallback, SQLTransaction, SQLStatementCallback, and SQLStatementErrorCallback interfaces can all be eliminated from WebDatabase