Re: [PR] Add a statements pool to DatasourceResourceLoader t o fix thread safety [velocity-engine]

arkanovicz (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.devel
Message-ID <PR_kwDOAN72MM55V4kw-106de6ee-dd49-45f9-b926-dcbcafeba793@gitbox.apache.org>
arkanovicz commented on PR #49:
URL: https://github.com/apache/velocity-engine/pull/49#issuecomment-2312538700

   > You are adding a new dependency tree many likely don't need at all
   
   Maybe shading would be appropriate, then.
   
   > JDBC drivers can also cache efficiently
   
   Maybe, but preparing a statement generally involves a round trip to the db server.
   
   > This should really be opt-in rather than default
   
   This could be done by introducing a new interface, DatabaseObjectsFactory, with two provided implementations, DefaultDatabaseObjectsFactory which would create a new connection and prepare the statements at each call, and a CachingDatabaseObjectsFactory which would keep a single connection and provide prepared statements pooling.
   
   I'd be ok with that.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.