I have found a solution for my problem.
The table was created as:
mnesia:create_table(pet_table, [{disc_copies, [node()]},
{type, set},
{attributes, record_info(fields, pet_info)}])
and this didn't work.
On the other hand by changing the name of the table to the same name used for the record it works.
mnesia:create_table(pet_info, [{disc_copies, [node()]},
{type, set},
{attributes, record_info(fields, pet_info)}])