<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>On Oct 31, 2007, at 4:56 PM, Ian Hickson wrote:</div><div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Monaco; font-size: 10px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; ">The fear is that people would do:<br><br> db.executeSql('...', [], function(...) {<br> db.executeSql('...', []); // depends on the first call<br> });<br><br>...without a transaction.<br></span></blockquote></div><div><br class="webkit-block-placeholder"></div><div>How is that wrong? If the first executeSql fails the error callback (if any) will fire, not the normal callback.</div><div><br></div><div><span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; "> db.executeSql('CREATE TABLE ...', [], function(...) {<br> db.executeSql('INSERT INTO ...', []);<br> });<br></span></div><div><br class="webkit-block-placeholder"></div><div>If the CREATE TABLE fails, the insert will never happen. If the INSERT fails, you don't really want the table to be rolled out. If you did, then you want a transaction. There are clearly times where you don't always want a transaction, but want to chain statements.</div><div><br class="webkit-block-placeholder"></div><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Verdana; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font class="Apple-style-span" size="2"><span class="Apple-style-span" style="font-size: 10px;"><span class="Apple-style-span" style="font-size: 10px; ">— Timothy Hatcher</span></span></font></div></div><br class="Apple-interchange-newline"></span> </div><br></body></html>