[Bug 607] New: ID of transient object is 0 after becoming persistent

View: New views
5 Messages — Rating Filter:   Alert me  

[Bug 607] New: ID of transient object is 0 after becoming persistent

by Bugzilla from bugzilla-daemon@helma.at :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://helma.org/bugs/show_bug.cgi?id=607

           Summary: ID of transient object is 0 after becoming persistent
           Product: Helma
           Version: CVS trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: HopObject Functionality
        AssignedTo: helma-dev@...
        ReportedBy: tobias.schaefer@...


Setting a property to a transient object leads to a "0" entry in the database
although the object is being made persistent during the same request:

var foo = new Foo;
var bar = new Bar;
bar.foo = foo;        // bar.foo === 0
root.bars.add(bar);
root.foos.add(foo);
//bar.foo = foo;

Removing the comment signs from the last line enables a work-around. However,
there are some situations where this simply is not reasonable.

Moreover, I wonder if this bug was introduced lately because it happens in code
I did not touch for quite a while. (But I am not really sure.)

I can provide a test case if wanted.


--
Configure bugmail: http://helma.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev

[Bug 607] ID of transient object is 0 after becoming persistent

by Bugzilla from bugzilla-daemon@helma.at :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://helma.org/bugs/show_bug.cgi?id=607





------- Comment #1 from hannes@...  2008-03-26 19:47 -------
That would be a pretty bad bug. I tried to reproduce this quickly, but it
worked for me. Can you provide a test app please?


--
Configure bugmail: http://helma.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev

[Bug 607] ID of transient object is 0 after becoming persistent

by Bugzilla from bugzilla-daemon@helma.at :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://helma.org/bugs/show_bug.cgi?id=607





------- Comment #2 from interface@...  2008-03-27 11:08 -------
Created an attachment (id=86)
 --> (http://helma.org/bugs/attachment.cgi?id=86&action=view)
Test app demonstrating the bug


I think I found the reason for the 0 ids: in the test app I attached to this
bug there's the foo_id property mapped in Bar.properties which IMHO is causing
the bug.

When I remove the foo_id mapping I get the expected result, ie. correct ids.

However, this cannot be a work-around since I need to map the equvalent to
foo_id in my setup because it is used in a generic object mapping.


--
Configure bugmail: http://helma.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev

[Bug 607] ID of transient object is 0 after becoming persistent

by Bugzilla from bugzilla-daemon@helma.at :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://helma.org/bugs/show_bug.cgi?id=607


hannes@... changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from hannes@...  2008-04-01 15:03 -------
The problem is that this kind of relations can't work with non-persistent
objects that do not have a database id. So the workaround is to call
root.foos.add(foo) or foo.persist() before assigning bar.foo = foo.

I've changed Helma to throw an explicit error when it encounters a situation
like this. Fixing the problem in a deeper way would be really really hard.


--
Configure bugmail: http://helma.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev

[Bug 607] ID of transient object is 0 after becoming persistent

by Bugzilla from bugzilla-daemon@helma.at :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://helma.org/bugs/show_bug.cgi?id=607


hannes@... changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |1.6.2




--
Configure bugmail: http://helma.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev
LightInTheBox - Buy quality products at wholesale price!