Fork me on GitHub
#sql
<
2018-08-22
>
stardiviner04:08:00

But I got error in jdbc/db-do-commands. It reports error:

stardiviner04:08:50

The log 这个 ResultSet 已经被关闭。 means This ResultSet is already closed.

stardiviner04:08:13

What happened? This code If I changed to MySQL, it works fine.

seancorfield17:08:20

@stardiviner could you try

(jdbc/db-do-commands postgresql-db false
                        [fruit-table-ddl
                         "CREATE INDEX name_idx ON fruit ( name );"])
(add false as the second argument). I think PostgreSQL treats transactions differently for DDL.

rcustodio20:08:44

what would you guys say between hikari and c3p0?

rcustodio20:08:42

@seancorfield thanks for the previous tip, that worked really well, im just trying to improve the pool now

seancorfield20:08:01

We use c3p0 happily in a high traffic production environment. We have not tried Hikari so I can't compare them. We did try BoneCP tho' -- that seemed faster overall than c3p0 but we saw fairly massive memory spikes during high traffic use so we went back to c3p0.

seancorfield20:08:59

I would say try both c3p0 and Hikari and see which works better for you -- swapping connection pool libraries is pretty easy (assuming you have a function that turns DB access information into a {:datasource connection-pool} style db-spec 🙂

rcustodio20:08:52

yeah… I`m using like that

rcustodio20:08:09

Im trying out hikari now

mpenet20:08:48

Hikaricp is advertised (and was benchmarked by a few) as the fastest and more efficient of the 2

rcustodio20:08:02

But sadly there some “heavy” query that makes jump from 80ms to 300ms to get the data

mpenet20:08:14

Happy hikaricp user here (prod/high volume as well)

rcustodio20:08:54

Thanks @mpenet for the insight, im gonna check it for sure

mpenet20:08:16

But yeah c3p0 is likely quite good as well, doubt you can go wrong with these 2

rcustodio20:08:21

I’m doing some tests right now on it, on my dev it was awesome, on production i still cant tell

rcustodio21:08:42

So… question about connection pool, if I put 100 at max, means that it can create 100 connections??? 100 threads?

seancorfield22:08:02

100 max what? You can control all sorts of aspects of a connection pool. Consult the documentation for details.