[erlang-questions] mnesia and QLC in dirty mode

Evans, Matthew mevans@REDACTED
Wed Sep 8 17:40:34 CEST 2010


Yup,

That was it...Well spotted :)

Thanks

Matt

-----Original Message-----
From: Igor Ribeiro Sucupira [mailto:igorrs@REDACTED] 
Sent: Wednesday, September 08, 2010 11:33 AM
To: Evans, Matthew
Cc: Erlang Questions Mailinglist
Subject: Re: [erlang-questions] mnesia and QLC in dirty mode

You are passing the atom read as the callback module:
http://erlang.org/doc/man/mnesia.html#activity-4

On Wed, Sep 8, 2010 at 12:24 PM, Evans, Matthew <mevans@REDACTED> wrote:
> Hi,
>
> What is the exact syntax for doing a QLC query in dirty mode?
>
>
> (sicm@REDACTED)149> Cursor =  mnesia:activity(sync_dirty, fun qlc:cursor/1, [qlc:q([R || R<- mnesia:table(cmfs_index_table)])], read).
> {qlc_cursor,{<0.3115.0>,<0.3102.0>}}
>
> (sicm@REDACTED)150> qlc:next_answers(Cursor,1).
> ** exception error: undefined function read:select/6
>     in function  mnesia:'-table/2-fun-1-'/4
>     in call from qlc:reply/4
>     in call from qlc:next_loop/3
> (sicm@REDACTED)151>
>
>
> If I wrap the qlc:next_answers in an mnesia:activity I get:
>
> (sicm@REDACTED)2> mnesia:activity(sync_dirty, fun qlc:next_answers/2, [Cursor,1], read).
> ** exception exit: {undef,[{read,select,
>                                 [{sync_dirty,<0.625.0>},
>                                  non_transaction,cmfs_index_table,
>                                  [{'$1',[],['$1']}],
>                                  100,read]},
>                           {mnesia,'-table/2-fun-1-',4},
>                           {qlc,reply,4},
>                           {qlc,next_loop,3},
>                           {mnesia_tm,non_transaction,5},
>                           {erl_eval,do_apply,5},
>                           {shell,exprs,7},
>                           {shell,eval_exprs,7}]}
>     in function  mnesia_tm:non_transaction/5
>     in call from mnesia_tm:non_transaction/5
>
>
> Any ideas?
>
> Thanks
>
> Matt
>



-- 
"The secret of joy in work is contained in one word - excellence. To
know how to do something well is to enjoy it." - Pearl S. Buck.


More information about the erlang-questions mailing list