orawrap icon indicating copy to clipboard operation
orawrap copied to clipboard

Migration to the core driver

Open CSester opened this issue 10 years ago • 3 comments

Hi @dmcghan,

Thank you for your job on this wrapper, but also to integrate the nice parts to the core driver.

But something is unclear to me... I cannot see the nice parts of orawrap in the core module (https://github.com/oracle/node-oracledb). Am I missing something or features as getting/releasing connection automatically from the connection pool have not been accepted ?

Thank you for your help !

Best regards,

Cyril

CSester avatar Apr 18 '16 07:04 CSester

@CSester I've not tried to get that into core yet. I'm picking 1 thing at time. When working with core it take a LOT more effort. Upfront thinking, coding for edge cases, writing tests, doc, etc.

I hope to propose this for a future release, but I think "pool management" is a little higher for me as I see the "simple execute" leveraging that feature.

What do you think?

dmcghan avatar Apr 18 '16 16:04 dmcghan

Yes, I fully agree with you that adding all these stuff into core won't be easy.

Going through the node-oracledb documentation, the main issue would be resultSet handling with automatic connection getting/releasing. BTW I never tried this with orawrap... ! Did you ever try this?

CSester avatar Apr 19 '16 15:04 CSester

In related news, a 1.9-dev branch was released today: https://blogs.oracle.com/opal/entry/node_oracledb_1_9_0

I was thinking about "simple execute" yesterday as I think it may help with a promise related issue where 2 promise chains are required: one to get the connection the other to use/release it. The issue is related to scoping on the connection object.

A simple execute method gets rid of the need to close the connection which should help, but as you say, there are some complexities around ResultSets, LOBs, and QueryStreams (which ride on ResultSets).

In Orawrap I checked for an "autoRelease" attribute in the execute's options parameter. If it was set to false then it would leave the connection open and return it as a property on the result object. I think we could do something similar in core, but I need to spend some time thinking it all through.

dmcghan avatar Apr 19 '16 15:04 dmcghan