Skip to content

Conversation

@zerolbsony
Copy link
Contributor

No description provided.

Comment on lines 41 to 61
private volatile long id;

private ClientVersion clientVersion;

private ZoneId zoneId;

private TimeZone timeZone;

private long userId;
private volatile long userId;

private String username;
private volatile String username;

private boolean login = false;
private volatile boolean login = false;

private long logInTime;

private SqlDialect sqlDialect = SqlDialect.TREE;

@Nullable private String databaseName;

private long lastActiveTime;
private volatile long lastActiveTime = CommonDateTimeUtils.currentTime();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add these volatile? As discussed last night, ConcurrentHashMap has already made sure that getAllConnections can see the changes made by other threads.

Copy link
Contributor

@CRZbulabula CRZbulabula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JackieTien97 JackieTien97 merged commit fad9bde into apache:master Dec 12, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants