[erlang-questions] Strange behaviour of ets

Sean Hinde <>
Wed Feb 27 13:52:39 CET 2008


Your ets table disappeared when the shell process (its owner) exited.

Sean

On 27 Feb 2008, at 12:01, Maxim Treskin wrote:

> Hello
>
> I see some strange behaviour of ets interaction.
> After I did an error in ets:select request, all following requests  
> are erroneous until, i.e. ets:new
> It is my session:
>
> --------------------------
> ()89> ets:new(test, [public, named_table]).
> test
> ()90> ets:insert(test, {{as, 2}, 23}).
> true
> ()91> ets:insert(test, {{qwe, 5}, 756}).
> true
> ()92> ets:insert(test, {{xcv, 3}, 111}).
>
> true
> ()93> ets:select(test, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
> [111,756,23]
> ()94>
>
> All is OK
>
> ()94> ets:select(qwe, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
>
> ** exception error: bad argument
>      in function  ets:select/2
>         called as ets:select(qwe,[{{{'$1','$2'},'$3'},[],['$3']}])
>
> Error
>
> ()95> ets:select(test, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
>
> ** exception error: bad argument
>      in function  ets:select/2
>         called as ets:select(test,[{{{'$1','$2'},'$3'},[],['$3']}])
>
> The same request as in 93 line, error also
>
>
> --------------------------
>
> Why this error happens?
>
>
> Thank you
>
> -- 
> Maxim Treskin _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list