Opened 10 years ago

Closed 10 years ago

Last modified 10 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

Description

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@… 10 years ago.
Code sample

Download all attachments as: .zip

Change History (7)

comment:1 by Shai Berger, 10 years ago

Resolution: needsinfo
Status: newclosed

Hi,

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.

Thanks,
Shai.

by manish_kumar9@…, 10 years ago

Attachment: code sample.txt added

Code sample

comment:2 by manish_kumar9@…, 10 years ago

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 by manish_kumar9@…, 10 years ago

Resolution: needsinfo
Status: closednew

comment:4 by Aymeric Augustin, 10 years ago

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 by manish_kumar9@…, 10 years ago

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 by Aymeric Augustin, 10 years ago

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 10 years ago by Aymeric Augustin (next)
Note: See TracTickets for help on using tickets.
Back to Top