Aziz
Aziz

Reputation: 55

Does cx_Oracle works with flask-python?

I'm wondering if cx_Oracle works with flask-python.

if so, please share with me a good documentation. it will be great.

Thank you All for your help.

Upvotes: 0

Views: 1252

Answers (1)

Christopher Jones
Christopher Jones

Reputation: 10506

See my blog post How to use Python Flask with Oracle Database which has a runnable example.

The key thing is that during application initialization you will want to start a connection pool with cx_Oracle.SessionPool(). Then each route can get a connection from the pool with connection = pool.acquire()

Also see https://www.oracle.com/webfolder/technetwork/tutorials/obe/cloud/apaas/python/python-oracle-accs/python-oracle-accs.html, however this doesn't use a connection pool so it has some scalability limitations.

Upvotes: 2

Related Questions