keedio / flume-ng-sql-source

Flume Source to import data from SQL Databases
Apache License 2.0
264 stars 164 forks source link

session check before close #61

Closed zhipcui closed 6 years ago

zhipcui commented 6 years ago

reseting connection should check if the session is open or not.

fixed https://github.com/keedio/flume-ng-sql-source/issues/60

lazaromedina commented 6 years ago

Hi zhipcui, thank you very much for your contribution. What about add this change to yours ?

private void resetConnection() throws InterruptedException{

        if(session.isOpen()){

            session.close();
            factory.close();

        } else {

                establishSession();

                 }
    }

best, Luis

zhipcui commented 6 years ago

Yep, look better. And I have pushed the change.