On Dec 13, 2007 5:32 PM, David King <[EMAIL PROTECTED]> wrote:
>
> I never thought I'd have to ask about thread safety in an Erlang
> library, but here goes. If I have two processes using erlydb at the
> same time with the psql driver, about 50% of my erlydb calls fail,
> with errors that vary widely. Here's one:
>
> ERROR erlang  code  crashed:
>   File: appmod:0
> Reason: {badarg,[{erlydb_base,get,2},
>                   {erlyweb,ewc,2},
>                   {erlyweb,render_subcomponent,2},
>                   {erlyweb,'-ewc/2-lc$^0/1-0-',2},
>                   {erlyweb,'-ewc/2-lc$^0/1-0-',2},
>                   {erlyweb,ewc,2},
>                   {erlyweb,render_subcomponent,2},
>                   {erlyweb,'-ewc/2-lc$^0/1-0-',2}]}
> Req: {http_request,'GET',{abs_path,"/"},{1,1}}

I've seen this error but only when I've misused ErlyDB by passing in a
tuple of the wrong type to an ErlyDB function.

>
> Here's another one:
>
> {ok,
>    {sql_error,
>     "25P02",
>     "Rexec_simple_query L928 Fpostgres.c Mcurrent transaction is
> aborted,
>      commands ignored until end of transaction block"}}
>
> (Yes, that says 'ok'; it's a return value from an erlydb 'find'
> function that *failed* that says 'ok' rather than throwing an
> exception.) For both of those, I can re-run the line of code and it
> works. Or doesn't. It depends. There are others, but none that I can
> reproduce in just a few seconds, which is maybe worse.
>
> Unless someone has a quick solution, I'm going to have to assume that
> this is indicative of a major design issue and start re-writing this
> driver. Or reconsidering erlydb at all. That's a serious architectural
> flaw. Are you *sure* you want to re-invent the database abstraction
> wheel?

The Postgres driver was created by Erlang Consulting and Roberto
Saccon did some modifications and also wrote the ErlyDB adapter for
it. Since I haven't used it, I can't vouch for its quality. From the
issues you're experiencing, it looks like the driver needs some
fixing. I doubt it's a major design issue -- it's probably a couple of
good ol' bugs.

ErlyDB isn't about re-inventing the DB abstraction wheel -- the wheel
simply hasn't existed for Erlang before ErlyDB.. ErlyDB is
conceptually very simple, by the way. It just generates a bunch of
functions that know how to output SQL based on their parameters. The
problems are from the Postgres driver. I use ErlyDB with MySQL a lot
in Vimagi and have never encountered this kind of bug.

>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to