Hi, I think better approach is creating static class with thread-safe singleton initialization of connection pool (for example, I use HikariCP for SQL db and JedisPool for Redis) and provide public access for getting connection from it to bolt. Init pool in prepare method, take connection,execute smth, give it back in execute method.
So every worker will get it's own pool which is shared between bolts. Best regards, Dmytro Dragan On Dec 5, 2014 11:57 PM, "Sa Li" <[email protected]> wrote: > Hi, all > > Right now I am able to write tuples into a file, and use copy command to > load into database, but this is obviously not a perfect solution, increase > complexity and overheads. Any idea to make it simpler? > > > thanks > > > Alec >
