JDBC Connection in prepare()

2014-03-17 Thread Manthosh Kumar T
Hi All, I'm trying add data to DB using JDBC in bolt. When I create Connection in the execute() method and close it at the end of execute() method, it works fine. Since it was slower, I created the Connection in prepare() method. But this time I'm getting SQLException saying No Suitable Dr

Re: JDBC Connection in prepare()

2014-03-17 Thread An Tran
Make sure that the JDBC drivers are deployed on all the system that Storm is running. I am not sure if this is correct or not but what i did is i copy all my dependencies into storm/lib folder On Mon, Mar 17, 2014 at 5:41 AM, Manthosh Kumar T wrote: > Hi All, > I'm trying add data to DB

Re: JDBC Connection in prepare()

2014-03-17 Thread Manthosh Kumar T
Hi Tran, I had deployed the JDBC Drivers properly. As I had said before, it works fine if the connection is created in the execute() method. So doesn't that mean Drivers are properly deployed?. Please correct me if I'm wrong. On 17 March 2014 15:25, An Tran wrote: > Make sure that the

Re: JDBC Connection in prepare()

2014-03-17 Thread Alexander Yerenkow
I see sometimes something like classloaders 'Race Condition' - when I can't get in one moment DB due to "No suitable driver", and in next Connection create I got it just fine. Maybe you should call Connection.create (which can fail), and add some init-delay for a few secs, and then second one coul

Re: JDBC Connection in prepare()

2014-03-17 Thread Richards Peter
That sounds weird. Are you sure that the expected database operation is being performed when the connection is established in execute()? Please add logs and see whether the expected results are generated. Program should not fail in both cases ideally. Only point is that the driver should be within