Comments (8)
The error message will be
ERROR: current transaction is aborted, commands ignored until end of transaction block
on Revision: 5049be9218a9.
However, you cannot continue transactions on SQL errors although the error can
be caught.
There is no relationship between "try" in JavaScript and SAVEPOINT in postgres.
We don't make a SAVEPOINT at "try" block.
We need to decide how to handle transaction-level errors in JavaScript.
I have 3 ideas about the issue:
A. Make SQL errors uncaught-able because users cannot ignore the error.
B. Support sub-transactions via making SAVEPOINTs for every "try" block.
C. Support sub-transactions via some special functions, like:
prepareTransaction(name);
try { ... }
catch (e) { rollbackToSavePoint(name); }
Comments and/or any better ideas?
Original comment by [email protected]
on 10 Nov 2011 at 2:07
- Changed state: Started
from plv8.
If we have no way to handle transaction in current implementation, I'd think
it's a good chance, so B. But what was drawback of B compared with C? It seems
to me that auto-transaction has kind of overhead.
Original comment by [email protected]
on 13 Nov 2011 at 7:01
from plv8.
It seems plpython makes subtransactions for each SPI execution. I think it's
better than B.
Original comment by [email protected]
on 13 Feb 2012 at 10:10
from plv8.
We might have an option for SPI exectuion something like ON_ERROR_ROLLBACK in
psql.
Original comment by [email protected]
on 13 Feb 2012 at 11:13
from plv8.
Original comment by [email protected]
on 6 Mar 2012 at 8:55
from plv8.
I don't like to introduce any options to users here. Do you mean introducing a
GUC to let users to choose the behavior??
Original comment by [email protected]
on 6 Mar 2012 at 9:10
from plv8.
I'm going to implement subtransaction() rather than try-catch.
subtransaction(function(){
executeSql(...)
})
BTW, I'm inclined to define a global object, plv8, to separate builtin function
namespace. Thoughts?
Original comment by [email protected]
on 18 Mar 2012 at 7:43
from plv8.
Pushed 485c509a9f3e5f9fd7425bc72970002618cbe217
Now executeSql runs the statement in a sub-transaction always. If the
statement fails, the sub-transaction is aborted and exception is thrown.
Subsequent process is allowed to run another SQL instead of SPI_finish()
failure or top-transaction abortion message.
Also like I said above, I added subtransaction function to let users make
explicit sub-transaction block. Since executeSql() now runs in its own
sub-transaction, users need explicit sub-transaction block when needed.
Original comment by [email protected]
on 23 Mar 2012 at 7:45
- Changed state: Fixed
from plv8.
Related Issues (20)
- Build error plv8 - using the `make` command HOT 8
- Upgrade from 2.3.12 to 2.3.15 failed in Postgresql v11.18 HOT 1
- Excited to Start working with 3.2alpha Branch HOT 2
- Invalid Discord link? HOT 2
- r3.2 Rocks HOT 2
- Many warnings when building v3.2.0 HOT 2
- /usr/bin/ld: cannot find -lv8_base_with_compiler: No such file or directory HOT 4
- Support for pg16 HOT 4
- plv8_info() causes segmentation fault HOT 2
- Unable to access transition tables declared in trigger HOT 1
- add functions setTimeout and setInterval HOT 11
- Async function call in trigger HOT 4
- Use of Promise HOT 2
- PGXN Build Fails
- undefined symbol: _ZTIN2v84base6ThreadE HOT 11
- Getting Error '-fexcess-precision=standard' is not supported when trying to compile PLV8 with EDB16 HOT 1
- Can't get access to things defined using start_proc HOT 9
- Build guide mistakes HOT 4
- How to use OUT params in plv8 stored proc HOT 1
- terminated with signal SIGTRAP v8::base::OS::Abort() HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plv8.