On Thu, 15 May 2014 00:07:47 -0700 (PDT)
"J. D." <john.arnold.dav...@gmail.com> wrote:

> 
> On Wednesday, 14 May 2014 21:08:11 UTC+4, Avraham Serour wrote:
> >
> > it looks like your error occurs when using django ORM with oracle, but in 
> > the beginning of your email you mention that you don't want to use it, so 
> > what's the problem here?
> >
> >  
> I want to reuse established connection with the Oracle DB (I thought django 
> connection helps with that out of the box). This is my first experience 
> with Oracle DB.
> 
> --
> 
> @Jani Tiaine, thanks for the help, but it doesn't work:
> 
> "ora_cur = connection.connection.cursor()  # See double connection stuff"
> 
> Exception Type: AttributeError  Exception Value: 
> 
> 'NoneType' object has no attribute 'cursor'

Oh sorry about that. It seems that connection attribute is only populated
when you have connection opened for something.

So you have to do initial dummy stuff:

connection.cursor()  # Opens connection

curs = connection.connection.cursor()   # Get raw cursor

Or, alternatively as a one liner:

curs = connection.cursor().cursor.cursor  # Get raw cursor


Hope that helps.

-- 

Jani Tiainen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20140516101623.130d069a%40jns42-l.w2k.keypro.fi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to