Hi!
In the java application I’m working on, I need to register any user session. The development team decided to use QuestDB with its java client.
Locally I created a docker container for questDB version 8.2.2, while using org.questdb:questdb:8.2.2
as dependency.
Sometimes, I didn’t understand why and how, some data is inserted incorrectly: string values becomes corrupted while timestamp values are set to 01/01/1970. I’m sure that the data I send to the server is correct and valued (I have log evidences).
The code i use is
try (Sender sender = Sender.builder(questDbConfig).build()) {
log.debug("inserting session entry {}", entry);
sender.table("sessions")
.stringColumn("username", entry.username())
.stringColumn("rolename", entry.roleName())
.stringColumn("sessionId", entry.sessionId())
.longColumn("numberOfMonitors, entry.numberOfMonitors())
.timestampColumn("startTime, entry.startTime())
.longColumn("duration", entry.duration())
.at(entry.endTime());
} catch (Exception e) {
log.error("error inserting session entry in QuestDB for session: {}", entry.sessionId(), e);
}
The configuration I use is as simple as http::addr=localhost:9000
. The table was created beforehands using the following command:
CREATE TABLE sessions
(
username VARCHAR,
roleName VARCHAR,
sessionId VARCHAR,
numberOfMonitors BYTE,
startTime TIMESTAMP,
duration INT,
endTime TIMESTAMP
) TIMESTAMP(endTime) PARTITION BY MONTH;
A select all returns some rows, and some of them containing the following values
while it should have contained the “Administrator” string. The screenshot was taken from datagrip, since the web console returns an error icon without any message and no data.
The docker container doesn’t log anything related to errors inserting data.
Am I doing something wrong here? Thanks!