mnesia and QLC in dirty mode

Evans, Matthew mevans@REDACTED
Wed Sep 8 17:24:13 CEST 2010


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


More information about the erlang-questions mailing list