Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#22769 closed Bug (needsinfo)

transaction.automic is not working as expected with Oracle DB for raw sql

Reported by: manish_kumar9@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


We have an usecase to store Blob data to DB. We are using raw sql to do that. We are wrapping method having this code with transaction.atomic decorator. The scenario work fine for MySQL database, but it fails with oracle DB. It works fine if we use self.connection.commit() explicit inside the method.

Attachments (1)

code sample.txt (1.1 KB) - added by manish_kumar9@… 7 years ago.
Code sample

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by Shai Berger

Resolution: needsinfo
Status: newclosed


We'd appreciate a little more details about this. A code sample that works with MySql and fails with Oracle will be nice.

When adding more details, please reopen the bug.


Changed 7 years ago by manish_kumar9@…

Attachment: code sample.txt added

Code sample

comment:2 Changed 7 years ago by manish_kumar9@…

Added code sample which is failing. Note : Instead of using @transaction.atomic if we put explicit commit i.e. self.connection.commit(), everything works fine.

comment:3 Changed 7 years ago by manish_kumar9@…

Resolution: needsinfo
Status: closednew

comment:4 Changed 7 years ago by Aymeric Augustin

A few questions...

  • When you're testing on MySQL, are you using the MyISAM or the InnoDB storage engine? (Since MyISAM doesn't support transactions, that would make the comparison irrelevant.)
  • Where is self.cursor coming from in your example?
  • Are you using more than one database?

comment:5 Changed 7 years ago by manish_kumar9@…

we support multiple database but at a time only one will be available for single installation. self.cursor is class variable where we have this mentioned method.

comment:6 Changed 7 years ago by Aymeric Augustin

Resolution: needsinfo
Status: newclosed

I'm sorry, but it's hard to help when you're answering only half of my questions and you aren't giving enough information for me to reproduce your problem.

If you provide a standalone piece of code that I can run and that has a different transactional behavior on MySQL + InnoDB and on Oracle, then I'll fix it.

(Please remember that I'm working on my free time to help you do you paid job.)

Version 0, edited 7 years ago by Aymeric Augustin (next)
Note: See TracTickets for help on using tickets.
Back to Top