rodhoward / node-sybase

23 stars 55 forks source link

Mutiple connection #4

Closed robertlarousso closed 8 years ago

robertlarousso commented 8 years ago

Good morning Rod, Since the beginning of 2016, I’m working with your package sybase build for nodejs.   I’m using it to ask my Sybase with many queries (between 4 and 13) in a very small time window. So I create 15 concurrent connections inside my nodejs code.   When I send one at a time, the query is compute in less than 500 ms. Howeve, if I send 2 or more queries at the same time, the performances are too deteriorated. Infact, my database is build to work with 50 connections ; if try to send all queries with Toad directly connected on the server, it is done in less than 500 ms.   So I have a question : Can I access JavaSybaseLink.jar class code ?   I need to understand how the package share queries and get response.   Thanks You Best Regards, Rémi Bruyère

martvaha commented 8 years ago

JavaSybaseLink.jar source is located at node_modules/sybase/JavaSybaseLink/src.

rodhoward commented 8 years ago

Yes all the code is available on git hub. I'm surprised that multiple simultaneous connections is working for you at all. It sounds like you should use a better library for what you are trying to do. The odbc library is probably a better use of your time as it has much better performance and reliability.

On 14 Sep. 2016 7:48 pm, "robertlarousso" notifications@github.com wrote:

Good morning Rod, Since the beginning of 2016, I’m working with your package sybase build for nodejs.

I’m using it to ask my Sybase with many queries (between 4 and 13) in a very small time window. So I create 15 concurrent connections inside my nodejs code.

When I send one at a time, the query is compute in less than 500 ms. Howeve, if I send 2 or more queries at the same time, the performances are too deteriorated. Infact, my database is build to work with 50 connections ; if try to send all queries with Toad directly connected on the server, it is done in less than 500 ms.

So I have a question : Can I access JavaSybaseLink.jar class code ?

I need to understand how the package share queries and get response.

Thanks You Best Regards, Rémi Bruyère

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rodhoward/node-sybase/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AF_kCbYkmRJW97b6Zixa8-IZXFcWliD3ks5qp8L1gaJpZM4J8lsX .

robertlarousso commented 8 years ago

Thanks you for your answer. I found a npm package to connect with a odbc driver. However I can't find a free odbc driver on the sybase website ; have you any suggestion ? Thanks you Remi Bruyère

rodhoward commented 8 years ago

Hi Robert,

I couldn't remember off the top of my head but I used FreeTDS see this link: http://www.unixodbc.org/doc/FreeTDS.html

And this tutorial might also help if your on linux: https://code.google.com/archive/p/pypyodbc/wikis/Linux_ODBC_in_3_steps.wiki

So looking back at the code the reason it doesn't support multiple connections very well is that everything needs to go over stdout and stdin between the java bridge and the node.js wrapper. Perhaps you could get around that by explicitly creating multiple Sybase classes which will each spawn a new java bridge and then round robin the calls into each of those. But as I said earlier I think your better off using a well tested and supported odbc driver for those kinds of loads.

Cheers Rod