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

michael-o (via GitHub) <[email protected]>
Newsgroups gmane.comp.jakarta.velocity.devel
Message-ID <PR_kwDOAN72MM55V4kw-8f1e7cf0-caf8-48f1-9b27-31916505b532@gitbox.apache.org>
michael-o commented on PR #49:
URL: https://github.com/apache/velocity-engine/pull/49#issuecomment-2312544737

   > > You are adding a new dependency tree many likely don't need at all
   > 
   > Maybe shading would be appropriate, then.
   
   The library is too huge, IMHO. Woudn't be wise in this case.
   
   > > JDBC drivers can also cache efficiently
   > 
   > Maybe, but preparing a statement generally involves a round trip to the db server.
   
   True, but I would expect that after the second run only metadata is exchanged. At least, we shouldn't try to be smarter than the DB.
   
   > > 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.
   
   Me as well.


-- 
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.