3
Problem
My form makes a statement requisição
a database (select, insert, update, delete values), but whenever these requests are made a lock occurs in the form (a freeze)! How to prevent forms from receiving these locks regardless of request?
Observing: The longer the request takes the longer the lock. An example is a select * from tabela;
that capture a large amount of values in the database. I’ve had both problems in JAVA and C#.
Heed: when I say request I am referring to connection and search in the database.
Are you talking about ajax requests made with Javascript? In this case, you should use an asynchronous request instead of synchronous.
– bfavaretto
How are you doing these requests, by ajax? By chance you are using
async: false
? If you are, you have to change that.– Marcelo Diniz
I’m with @bfavaretto on this, regarding what I understood of your question.
– Tiago César Oliveira
@bfavaretto good do not use web languages in these projects, are form (Windows) desktop. The window that ends up freezing until the request to the bank ends.
– noNihongo
Ah, now it’s clear. So look at Danimar Ribeiro’s answer, I think that’s what you’re looking for.
– bfavaretto
select * from tabela
every request? Something is much wrong there.– Leonel Sanches da Silva
A form has the function of generating a report! By clicking the button the report is generated with database values. Should I say that a request was made to the database? @Ciganomorrisonmendez.
– noNihongo
@Eduardobentorochajunior there are several optimizations to do: do not use
select *
is just one of them. You can implement paging, caching... It would be excellent beginnings to make your search more performative. On the BD side, create the relevant indexes, etc– Tiago César Oliveira
Got it, thanks @Tiagocésaroliveira I will research on the subject. I passed the example of
select * from tabela
as a simple way that everyone understands.– noNihongo