0

I am using HSQLDB in my application and want to check the rows inserted by the application without stopping my application. Though i am able to connect to the database file in read-only mode, the "select * from table-name" does not fetch the latest records entered by the application.

Is there any way to read the latest data inserted by the application without closing the appliaction?

I have tried using DatabaseManagerSwing and DBVisualizer tools.

I dont want to use Server-mode.

user2048204
  • 729
  • 4
  • 13
  • 27
  • You probably need to run HSQDLB in server mode, not in-process –  Jan 09 '20 at 16:00
  • Thank you. But as i said i dont want to use server mode. I just want to connect as read-only mode but just be able to fetch the latest records – user2048204 Jan 09 '20 at 16:02

1 Answers1

0

When you connect to a file: database in read-only mode, the snapshot of the database at the last CHECKPOINT is read. The changes after the CHECKPOINT are not read.

If the database has been opened and is being modified by your app process, it remains under the control of this process. A second process cannot control what it sees.

As you want to use DatabaseManagerSwing, it is quite simple to start this program by your application. When you make a connection from this instance of DatabaseManagerSwing, it shows the same data as modified by your app. This connection shouldn't be in read-only mode, and you can even modify data from the manager.

fredt
  • 24,044
  • 3
  • 40
  • 61