Menu

Bonus Feature

2015-10-06
2015-10-07
  • Brenton Pyl

    Brenton Pyl - 2015-10-06

    Bonus Feature Request: Support Transactions in TableReader interface.

    Currently I need to connect to a remote SFTP location to grab a file for testing, but the CSV JDBC drivers currently don't support transactions, so it has to make lots of connections to the file for all the various QA tests that I run the file through.

    Use Case: I am using Spring, so the transaction manager will attempt to create a transaction and getConnection on all of the data sources at the top of the method, then close it at the bottom. Ideally, I'd want the connection to the remote server to start and stop with it, but execute multiple SQL statements against the remote file (downloading each time, but not needing to connect again each time).

    Story: I'd like to support transaction handling in the TableReader interface to allow a more formal integration between your Connection objects, and my lower level SFTP connections. So that I can allow a getConnection on your data source, pass that request for a connection/transaction back to the TableReader, then the getReader() can be called however many times is necessary before the connection is closed again and pass that close back to the TableReader to close the SFTP connection.

    Current State: To do this in your current library, I had to create wrapper data sources around yours and shamelessly hack connection management around your Connection objects.

     
  • Simon Chenery

    Simon Chenery - 2015-10-07

    Can you use the database table name to signal when connections or downloads should be started or stopped? The table name is passed down to your TableReader object.

    Something like:

    select dummy from openRemoteConnection
    select * from t1
    select * from t2
    select * from t3
    select dummy from closeRemoteConnection
    

    or,

    select * from t1_openFirst
    select * from t2
    select * from t3_closeAfter
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.