Are there any frameworks for handling database queries in swing applications?

I believe that any programmer who has dealt with database queries in a gui application has encountered some or all of the following problems:

  • Your GUI freezes because you are invoking the database level inside the Send thread event
  • When you have multiple windows / panels / jframes where the user can start the db request, your performance degrades because you do not have control over the threads created by the user.
  • The user can lock the application and even the database, because he calls an action many times before the first action is completed.

What I would like to know about: are there any frameworks that meet the requirements of processing an ordered set of long-term actions (including, but not limited to, database calls, i.e. computations) outside the event dispatch stream?

Note: I know SwingWorker; -)

+4
source share
3 answers

Such a thing must be found, for example, in Netbeans. See RequestProcessor. But in simpler cases this is not required. Last time I needed something like thread planning and management. I just used the new concurrency packages included in J5 (I used J6). With its ExecutorFactory-ies, you can simply achieve basic control over tasks. You can also use multiple queues. This pdf can help . PDF is written in Slovak, but Single / Multiple task employees are written in Java;)

+1
source

Naked objects facilitate a clean domain model, and also have a GUI 2 DB display layer - http://www.nakedobjects.org/home/index.shtml

+2
source

I doubt that you will find something specific for database queries. You can try to reuse existing shared task scheduling libraries. An example is the Eclipse API. It does not depend on the IDE.

See http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html

+1
source

Source: https://habr.com/ru/post/1277248/


All Articles