Error when quering from db from 2 widgets
When i want to update 2nd widget after 1st widget transaction is commited and signal is emitted from 1st (after commit), i get this error in 2nd widget:
@ dbo::Session& session = PlannerApplication::plannerApplication()->session;
typedef dbo::collection<dbo::ptr > Entries;
Entries entries = user->entriesInRange(date.addDays(--10), date ); // place where i get error@
Wt: error during event handling: A collection for 'select count(1) from (select ""id"", ""version"", ""user_id"", ""date"", ""start"", ""stop"", ""summary"", ""text"" from ""entry"" where (""user_id"" = ?) and (start >= ?) and (start < ?))' is already in use. Reentrant statement use is not yet implemented.\"
Updated by Roel Standaert about 5 years ago
You certainly can emit signals in transactions.
Wt for the most part work independently, except for some
Dbo-specific features in
The reason why this happens is because
Wt::Dbo at the moment does not support using the same SQL prepared statement twice for a certain connection. Do you have another
Entries collection around at the same time? Or another very similar query?
There are several ways that you can prevent this from happening, e.g. you can first copy the
collection into an STL container, freeing the underlying query, see the documentation for