Open SavageTee opened 2 years ago
YES i'm currently suffering from the exact same problem. In my app, i'm calling multiple times my service class, that first fecthes all of some of my instances, then fetches only a specific one. Two queries to the database, and two stored procedures. Never had no problem with calling service functions rapidly in time, but here i call both async functions to resolve a future builder and it seems like the queries are overlaping each other : the fetch one returns me ALL of the instances, si it gives me the result of the last query ... i can use a workaround by adding a delay between the queries, or changin strategy by opening a new connection to the database every time i call a service function, so before every query (but this solution is less performant, as it requires to reconnect often, even though i know its a common practice in some extent)
If anybody knows anything about this weird phenomena, i'd be happy to know more about it : its been driving me crazy for days ...
YES i'm currently suffering from the exact same problem. In my app, i'm calling multiple times my service class, that first fecthes all of some of my instances, then fetches only a specific one. Two queries to the database, and two stored procedures. Never had no problem with calling service functions rapidly in time, but here i call both async functions to resolve a future builder and it seems like the queries are overlaping each other : the fetch one returns me ALL of the instances, si it gives me the result of the last query ... i can use a workaround by adding a delay between the queries, or changin strategy by opening a new connection to the database every time i call a service function, so before every query (but this solution is less performant, as it requires to reconnect often, even though i know its a common practice in some extent)
If anybody knows anything about this weird phenomena, i'd be happy to know more about it : its been driving me crazy for days ...
at last i used this workaround by disconnect/reconnect at every query
using stored procedures one after another gives unexpected behavior here is my code ...
when pressing button to call the three stored procedure and print each result i get the following
I/flutter ( 6271): (Fields: {outletfrom: 00, outletto: 11}) >> Result of the first call I/flutter ( 6271): () >> Second call is empty I/flutter ( 6271): (Fields: {serverid: 1}) >> The third result is the result of the second call