erlydb_psql transactions appear broken

14 views
Skip to first unread message

David King

unread,
Dec 3, 2007, 10:42:17 PM12/3/07
to erlyweb
Using psql, I can create save an instance of a model like this:

my_model:save(my_model:new_with([{name,"1"}])).

But if I try to save the same model inside of a transaction, like this:

my_model:transaction(fun() ->
my_model:save(my_model:new_with([{name,"1"}]))
end).

I get the SQL error:

{atomic,{ok,{sql_error,"25P02",
"Rexec_simple_query L928 Fpostgres.c Mcurrent
transaction is aborted, commands ignored until end of transaction
block"}}}

At least the error is atomic!

1. Why doesn't the process die, rather than returning "OK"?
2. Why can't I do this inside of a transaction?
3. Is anybody actually running against psql? Has anybody tested this
driver?

Yariv Sadan

unread,
Dec 5, 2007, 12:05:42 AM12/5/07
to erl...@googlegroups.com
Roberto Saccon created this driver, so he should have the most
authoritative opinion on this issue. I haven't tested it but the unit
tests have passed according to other people. Unfortunately, it looks
like the unit tests haven't covered this case. You can try fixing it
(you can see how the MySQL driver handles transactions) or... switch
to MySQL :)

Yariv

David King

unread,
Dec 6, 2007, 9:18:11 PM12/6/07
to erl...@googlegroups.com
> Roberto Saccon created this driver, so he should have the most
> authoritative opinion on this issue. I haven't tested it but the unit
> tests have passed according to other people. Unfortunately, it looks
> like the unit tests haven't covered this case.

The unit tests don't cover *running a transaction*?

Yariv Sadan

unread,
Dec 7, 2007, 3:50:59 AM12/7/07
to erl...@googlegroups.com

Apparently not :)

I should have been adding more test cases as I've been more features
to ErlyDB since I first wrote the tests a long time ago,

Yariv

Reply all
Reply to author
Forward
0 new messages