Does net.sf.jsqlparser.statement.Statement thread safe? #1627
Copy link
Copy link
Closed
Description
Activity
manticore-projects commented
on Sep 12, 2022 ContributorMore actionsGreetings.
You can certainly cache Statements if you are in a situation when you would have to parse similar, but very complex statements many times. Although I have a hard time to construe such a situation.
The more interesting challenge was to decide when a statement is equal. It would depend on a reliable hash of the SQL String -- after replacing any fixed Values (String, Boolean, Double, Long, Date) with parameters.
Determining this hash would depend on parsing the statement -- defeating the purpose.
Long story short: you can cache statements but I wonder why you would want to do that. Maybe you will need to elaborate on the exact challenge you want to overcome.
Cheers.
Reacted by Leo
Metadata
Metadata
Assignees
Labels
No labels
Should I reusing Statement increases performance?