[erlang-questions] Looking for RDBMS driver with Transaction Support.

104 views
Skip to first unread message

Alex Arnon

unread,
May 2, 2011, 2:24:31 PM5/2/11
to Erlang Questions
Hi All,

Is there an RDBMS driver in the Erlang universe whose API supports transactions?
The docs for odbc, epgsql and emysql do not specify any kind of transaction support.

Thanks in advance!

Ulf Wiger

unread,
May 2, 2011, 2:41:21 PM5/2/11
to Alex Arnon, Erlang Questions

On 2 May 2011, at 20:24, Alex Arnon wrote:

Hi All,

Is there an RDBMS driver in the Erlang universe whose API supports transactions?
The docs for odbc, epgsql and emysql do not specify any kind of transaction support.

Erlydb had transaction support, and some people may still be using it.


ODBC actually does too. You use odbc:connect/2 followed by odbc:commit/2,
unless you have {auto_commit, on}, in which case every query is a transaction.

BR,
Ulf W

Ulf Wiger, CTO, Erlang Solutions, Ltd.



Parnell Springmeyer

unread,
May 2, 2011, 2:43:07 PM5/2/11
to Alex Arnon, Erlang Questions
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

https://github.com/dizzyd/erlang-mysql-driver

Look at the tests to see how transactions are used. I use them
extensively in my current project.

Alex Arnon <alex....@gmail.com> writes:

> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions

- --
Parnell "ixmatus" Springmeyer (http://ixmat.us)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJNvvs7AAoJEPvtlbpI1POLvQcH/jyrjTekFE3P0FeF6dn84ROo
mAQQWI0cKGM8gLJOJA0kzaf3kEOZ4Ad6qBot2cXU1W5jWBDxRdf0DcvlsGCXx7uN
fNOfLCug6/3NNICkCjTUu+mtE1zs3itxj4LU87fbNe9h65MelASwQh7NnXob11A2
5ylQBXgzEdv6AaPavdO/ej9qRNDA0QieVTFaECW0Pzaly87q9XkBqkgQqoFt34Ta
eAbewn90VhuQKB1GZZJDUOH58l57H2RaMKUqSqYMCCmqxwXXAmNUKyNYOsurx7za
gCjSEBZ7JvCb+3yyLj6SWlHgTFypYNtZK+861lNLd8i2aKPsOuWHIo/9pkprO94=
=PPX8
-----END PGP SIGNATURE-----
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Alex Arnon

unread,
May 2, 2011, 3:18:11 PM5/2/11
to Parnell Springmeyer, Ulf Wiger, H. Diedrich, Erlang Questions
Thank you all for the solutions, this is very helpful!
We will evaluate the epgsql and erlang-mysql solutions.

Robert Raschke

unread,
May 3, 2011, 4:11:26 AM5/3/11
to Alex Arnon, Erlang Questions
Just to reiterate Ulf's point, in case you missed it. The standard Erlang odbc module supports transactions when you odbc:connect/2 using the option {auto_commit, off}.

Although, if I remember correctly, nested txns are not supported.

Robby

Alex Arnon

unread,
May 3, 2011, 8:19:33 AM5/3/11
to Robert Raschke, Erlang Questions
Good - we don't need nested transactions.
Thanks!

mabrek

unread,
May 3, 2011, 8:39:02 AM5/3/11
to Alex Arnon, Erlang Questions
On Mon, May 2, 2011 at 10:24 PM, Alex Arnon <alex....@gmail.com> wrote:
> Hi All,
>
> Is there an RDBMS driver in the Erlang universe whose API supports
> transactions?
> The docs for odbc, epgsql and emysql do not specify any kind of transaction
> support.

epgsql does have simple transaction support, take a look at function
with_transaction/2 at
https://github.com/wg/epgsql/blob/master/src/pgsql.erl

Regards,
Anton Lebedevich

Alex Arnon

unread,
May 5, 2011, 3:40:34 AM5/5/11
to mabrek, Erlang Questions
Oh, excellent! Thank you very much!

Jr0

unread,
Aug 7, 2012, 4:52:43 PM8/7/12
to erlang-q...@erlang.org
I know that the Odbc library has a commit/2 and commit/3, but I'm not sure if
I am interpreting its use correctly.

If I create a session with the {auto_commit, off} attribute and then do a
series of separate sql_query/2 SELECT statements (not batched statements,
but separate invocations of sql_query/2), followed by a committ/2, are the
selects all done within a single transaction guaranteeing ACID properties?

I am using Oracle, by the way



--
View this message in context: http://erlang.2086793.n4.nabble.com/Looking-for-RDBMS-driver-with-Transaction-Support-tp3490646p4655140.html
Sent from the Erlang Questions mailing list archive at Nabble.com.

nx

unread,
Aug 7, 2012, 4:55:39 PM8/7/12
to Alex Arnon, Erlang Questions
erlang-mysql-driver has transactions support:
https://github.com/dizzyd/erlang-mysql-driver

Paul Oliver

unread,
Aug 7, 2012, 5:06:19 PM8/7/12
to Alex Arnon, Erlang Questions
Reply all
Reply to author
Forward
0 new messages