db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Re: [jira] Closed: (TORQUE-69) Record.save() may not work if there is no primary key but no error is thrown.
Date Thu, 18 Oct 2007 07:33:09 GMT
Other OR mappers remember the original values they have read from the db.
So they can
a) still select the original data row if no pk is available, or cope with
changed pk's (shudder, but every year somebody asks to do this on the user
list)
b) update only the changed fields (not sure if this is desirable, may kill
caching of prepared statements)
c) make the data available to the user

Maybe at some time in the future we should consider to keep the original
data.. But it also has problems:
- it increases the amount of memory an object needs
- it is more complicated

    Thomas


Thomas Vandahl <tv@apache.org> schrieb am 17.10.2007 19:55:10:

> Thomas Fischer (JIRA) wrote:
> >      [
https://issues.apache.org/jira/browse/TORQUE-69?page=com.atlassian.
> jira.plugin.system.issuetabpanels:all-tabpanel ]
> >
> > Thomas Fischer closed TORQUE-69.
> > --------------------------------
> >
> >        Resolution: Fixed
> >     Fix Version/s: 3.3-RC3
> >
> > An exception is now thrown an an attempt to update an object without
primary
> key. The previous behavior was to fail silently.
>
> I'm not entirely sure if that is indeed the solution for the problem
> (even if it has been suggested in the issue). Sometimes one has to cope
> with existing database designs. In this case, Torque would simply refuse
> to work - which is least annoying.
>
> I suspect that any O/R mapper will have problems with tables without
> primary keys because there is no fixed object/record-relation.
> Nevertheless those table designs exist. How do others handle this case?
>
> Bye, Thomas.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message