Michael Bayer wrote:
its definitely not a threading prob within SA. could be a "dirty flag" type of thing. or it is conceivable that your dependencies are not being set properly when you are committing; I have noticed on a surprisingly enormous number of occasions that printing out data affects the way dictionaries internally order themselves, which produces different results upon sorting dependencies. dependency problems dont seem too frequent anymore although the most likely place for them to crop up would be if you have any self-referential mappers or other circular dependency relationships between several mappers.

an error like this definitely requires looking at, and testing, a full mapper setup for us to even begin to think what might be going wrong (also if youre having objectstore dependency probs with a correctly configured set of mappers, this is an extremely important issue to me).

some other data that is generally needed for this is if you create your engine with "echo_uow=True", or set objectstore.LOG =True , then send me the giant "dependency graphs" it produces when you say commit()....one where it works OK, and another where it fails.

okay heres the good one

Task dump:
UOWTask(1083807852) 'Employee/employee/1083260364'
 |
 |- Save dependencies
|- UOWDependencyProcessor(1083807820) 'employee' attribute on saved Timesheet's (UOWTask(1083807436) 'Timesheet/timesheet/1083332908')
 |       |-UOWTaskElement(1083807596): Timesheet(1083585740) (save)
 |
 |- Child tasks
 |- UOWTask(1083807788) 'Project/project/1083259852'
 |   |
 |   |- Save dependencies
| |- UOWDependencyProcessor(1083807756) 'project' attribute on saved Timesheet's (UOWTask(1083807436) 'Timesheet/timesheet/1083332908')
 |   |       |-UOWTaskElement(1083807596): Timesheet(1083585740) (save)
 |   |----
 |
 |- UOWTask(1083807692) 'Task/task/1083300940'
 |   |
 |   |- Save dependencies
| |- UOWDependencyProcessor(1083807724) 'task' attribute on saved Timesheet's (UOWTask(1083807436) 'Timesheet/timesheet/1083332908')
 |   |       |-UOWTaskElement(1083807596): Timesheet(1083585740) (save)
 |   |
 |   |- Child tasks
 |   |- UOWTask(1083807436) 'Timesheet/timesheet/1083332908'
 |   |   |
 |   |   |- Save elements
 |   |   |- Save: UOWTaskElement(1083807596): Timesheet(1083585740) (save)
 |   |   |----
 |   |
 |   |----
 |
 |----

and heres the bad

Task dump:
 UOWTask(1085387884) 'Employee/employee/1083260364'
  |
  |- Save dependencies
|- UOWDependencyProcessor(1085387852) 'employee' attribute on saved Timesheet's (UOWTask(1085387340) 'Timesheet/timesheet/1083332908')
  |       |-UOWTaskElement(1085387180): Timesheet(1084505292) (save)
  |       |-UOWTaskElement(1085387212): Timesheet(1085345836) (save)
  |
  |- Child tasks
  |- UOWTask(1085387532) 'Project/project/1083259852'
  |   |
  |   |- Save dependencies
| |- UOWDependencyProcessor(1085387692) 'project' attribute on saved Timesheet's (UOWTask(1085387340) 'Timesheet/timesheet/1083332908')
  |   |       |-UOWTaskElement(1085387180): Timesheet(1084505292) (save)
  |   |       |-UOWTaskElement(1085387212): Timesheet(1085345836) (save)
  |   |----
  |
  |- UOWTask(1085387756) 'Task/task/1083300940'
  |   |
  |   |- Save dependencies
| |- UOWDependencyProcessor(1085387436) 'task' attribute on saved Timesheet's (UOWTask(1085387340) 'Timesheet/timesheet/1083332908')
  |   |       |-UOWTaskElement(1085387180): Timesheet(1084505292) (save)
  |   |       |-UOWTaskElement(1085387212): Timesheet(1085345836) (save)
  |   |
  |   |- Child tasks
  |   |- UOWTask(1085387340) 'Timesheet/timesheet/1083332908'
  |   |   |
  |   |   |- Save elements
  |   |   |- Save: UOWTaskElement(1085387180): Timesheet(1084505292) (save)
  |   |   |- Save: UOWTaskElement(1085387212): Timesheet(1085345836) (save)
  |   |   |----
  |   |
  |   |----
  |
  |----

The bad seems to be doing a save twice.

Thanks

Huy
On Mar 8, 2006, at 6:09 AM, HD Mail wrote:

Hi,

I am using sqlalchemy with pylons. I have a very simple table with a foreign key to another table.

I pretty much submit a form load the values into the object and use objectstore.commit() to save the record.

Once in a while I get a strange error where it complains that the foreign key is null (this value is definitely being set however). The strange thing, is that if I resubmit the form, it works. More strange, if I print the supposedly missing value, right after it is assigned, I never get this error. I am at a lost to why I am gettting this intermittent behaviour. Is it some sort of problem with dirty/null detection or a threading problem ?


Thanks

Huy





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to