Hi -
I'm attempting to use Sandstone and ran into the error in the subject line on the initial save. I found this discussion: http://forum.world.st/Contexts-must-only-be-created-with-newForMethod-td3710463.html But don't know how to adapt it to 'fix' my error. Should I just overwrite #basicNew: in my image? I'm attempting to use the Fuel serializer and I loaded Fuel from the metacello config. Thanks Paul |
On Fri, Sep 9, 2011 at 6:58 PM, Paul DeBruicker <[hidden email]> wrote: Hi - This should not happen. Can you tell me which version of Fuel did you install with Metacello? and more precisely which version of Fuel package.
-- Mariano http://marianopeck.wordpress.com |
In reply to this post by Paul DeBruicker
On Fri, Sep 9, 2011 at 6:58 PM, Paul DeBruicker <[hidden email]> wrote: Hi - To which class is it sending the #basicNew? because it shuld not do it. Can I reproduce it somehow?
-- Mariano http://marianopeck.wordpress.com |
Can you run the Fuel tests and see if there is one failing ?
On Fri, Sep 9, 2011 at 7:06 PM, Mariano Martinez Peck <[hidden email]> wrote:
-- Mariano http://marianopeck.wordpress.com |
In reply to this post by Paul DeBruicker
I'm using Pharo 1.3. The Fuel versions are:
Fuel-MartinDias.338 FuelTests-MartinDias.84 160 of 160 tests pass. The config version is: ConfigurationOfFuel-MartinDias.65 I loaded the #stable version for 1.3. #sandstoneDeepCopyVisits: is calling basicNew: on the class MethodContext. The Sandstone DB versions are SandstoneDb-RamonLeon.144 SandstoneDbTests-RamonLeon.10 |
In reply to this post by Paul DeBruicker
And I'd guess that it's not a Fuel issue but a SandstoneDB issue because
I get the same error if, when using the same image, in a workspace I change the SDSerializer to the SDSmartRefStreamSerializer and try again. |
In reply to this post by Paul DeBruicker
On 09/09/2011 10:36 AM, Paul DeBruicker wrote:
> > #sandstoneDeepCopyVisits: is calling basicNew: on the class MethodContext. Because SandstoneDb isn't meant to save special objects like classes, blocks, or method context's, it's meant to save plain old Smalltalk data objects from your domain the same way you'd use a relational database. It's a simple active record data store for quick prototyping based on serialized files, not a full blown object database that can save every possible object type. > And I'd guess that it's not a Fuel issue but a SandstoneDB issue because I get the same > error if, when using the same image, in a workspace I change the SDSerializer to the > SDSmartRefStreamSerializer and try again. Correct. Now, apparently fuel might be able to save some of those special objects like blocks or classes, but SandstoneDb will throw an error if you attempt to save a class regardless of what the serializer supports. -- Ramon Leon http://onsmalltalk.com |
In reply to this post by Paul DeBruicker
On Fri, Sep 9, 2011 at 7:44 PM, Paul DeBruicker <[hidden email]> wrote: And I'd guess that it's not a Fuel issue but a SandstoneDB issue because I get the same error if, when using the same image, in a workspace I change the SDSerializer to the SDSmartRefStreamSerializer and try again. I imagine. That's why I've asked. Maybe Ramon can help. You can also attach PharoDebug.log -- Mariano http://marianopeck.wordpress.com |
In reply to this post by Ramon Leon-5
On Fri, Sep 9, 2011 at 7:48 PM, Ramon Leon <[hidden email]> wrote:
Be careful with SortedCollection instances for example ;)
indeed. Contexts, classes, CompiledMethod, etc... , but SandstoneDb will throw an error if you attempt to save a class regardless of what the serializer supports. -- Mariano http://marianopeck.wordpress.com |
On 09/09/2011 10:50 AM, Mariano Martinez Peck wrote:
> Be careful with SortedCollection instances for example ;) Yes, SandstoneDb can't store those because of the sort block, store an OrderedCollection and sort it on the fly when you need it. Maybe I'll add support since Fuel supports it, but I have a feeling it's a can of worms I don't want to open for lack of commitment at the moment. -- Ramon Leon http://onsmalltalk.com |
In reply to this post by Paul DeBruicker
> Re: SandstoneDB, Fuel - Contexts must only be created with newForMethod:
> > In reply to this post by Paul DeBruicker > On 09/09/2011 10:36 AM, Paul DeBruicker wrote: >> >> #sandstoneDeepCopyVisits: is calling basicNew: on the class MethodContext. > > Because SandstoneDb isn't meant to save special objects like classes, > blocks, or method context's, it's meant to save plain old Smalltalk data > objects from your domain the same way you'd use a relational database. > It's a simple active record data store for quick prototyping based on > serialized files, not a full blown object database that can save every > possible object type. > I've attached the PharoDebug.log. It seems to be choking when trying to save an instance of a RangeConstraint class from the Chronos package. The RangeConstraint class stores two different blocks in two different i-vars. The RangeConstrait is there because I'm saving instances of the Timepoint class from the Chronos package. Seems like I should just use the onBeforeSave and onAfterSave to switch between Timepoint instances to DateAndTime for storing the dates and times. Plus the timeZones. Or is there another strategy you'd recommend? Thanks Paul PharoDebug.log (35K) Download Attachment |
On 09/09/2011 11:13 AM, Paul DeBruicker wrote:
> Seems like I should just use the onBeforeSave and onAfterSave to switch > between Timepoint instances to DateAndTime for storing the dates and > times. Plus the timeZones. > > Or is there another strategy you'd recommend? > > Thanks That sounds reasonable actually, sort of a manual serialization prep down to raw data. However, you'd need an onLoad as well for a fresh image start from disk. I just realized I don't have a load event; I'll add one. -- Ramon Leon http://onsmalltalk.com |
In reply to this post by Ramon Leon-5
On Fri, Sep 9, 2011 at 7:55 PM, Ramon Leon <[hidden email]> wrote:
Yes, basically because it is likely you will end up serializing a whole stack. If you follow a BlockClosure sender sender sender blah blah home home blah blah yes...it is complicated. -- Mariano http://marianopeck.wordpress.com |
On 09/10/2011 02:23 AM, Mariano Martinez Peck wrote:
> Yes, basically because it is likely you will end up serializing a whole > stack. If you follow a BlockClosure sender sender sender blah blah > home home blah blah > yes...it is complicated. Hence my advice when attempting to save blocks in SandstoneDb... don't do that. Databases are for data, not for suspended execution environments like closures. -- Ramon Leon http://onsmalltalk.com |
Free forum by Nabble | Edit this page |