In Riak, if a link is created from object A to object B, and object B is then deleted, what happens to the link stored in the metadata of object A? Must the link be manually deleted? Or is it automatically deleted?
They must be manually deleted.
A link is just a metadata entry and there is nothing stopping you from creating a link with a target that doesn't exist, so a missing link target is not explicitly an error.
Links are one-way. When operating on object B there is no way to determine that object A contains a link to object B, so Riak does not provide an automated method for an operation on object B to trigger an update to object A.
If there is some way to divine which objects may contain links, your application code would need to handle updating the links.
Related
There is a folder in a Google Storage bucket.
I need to delete (with JSON API) the folder (let denote it xxx/) if and only if it is empty.
The most obvious way is to check if it is empty and delete if it is empty. This requires an additional request and also may be subject to race conditions.
However, what about deleting the xxx/ object unconditionally? If it is empty deleting will do what we need, and if it is nonempty xxx/ will continue to behave like a folder because there are files with prefix xxx/.
Are there any troubles with this way (that is with removing the xxx/ object unconditionally on whether it has or doesn't have subobjects)?
Deleting the xxx/ object will not delete any objects "inside" the folder.
Note that that object is created by tools (like the Cloud Storage web console) to support the illusion of a folder inside what's actually a flat namespace in GCS (i.e., to the service there are no folders, and the "/" character is used by tools to mimic there being folders inside the bucket).
The only way to do what you want is to get a list of the objects under the xxx/ prefix and not delete the xxx/ object if that list is non-empty. However, doing that has an inherent race condition, since someone could write a new object after you make the check.
I have a transmogrifier pipeline to insert objects to my Zope database (importing zexp files from a directory structure). This works - the objects are created; but I don't get them added to the portal_catalog.
I added a section to add the objects to the catalog explicitly, inspired by plone.app.transmogrifier.reindexobject: I call portal_catalog.catalog_object(obj) for each item.
The objects exist, and getPhysicalPath yields the correct values, but the objects are not added. There is no error message or exception whatsoever.
I tried to specify the list of indexes (the idxs argument), but this didn't change anything. If not specified, all indexes should be filled anyway, right?
Since it looks like a transaction problem to me (no errors, but nothing stored in the catalog either), I tried transaction code (begin, savepoint, commit, and in case of exceptions abort), but it didn't help. When I call the catalog immediately after the catalog_object call (portal_catalog(path='/Plonesite/full/path/to/object')), nothing has happened, and an empty list is returned.
The catalog does contain objects; even objects of my custom datatypes (AT-based). Not even the Folder objects of my imports are indexed.
Without the objects in the catalog, my import is useless. What can I do?
Thank you!
Edit: Any hint about how to get my object trees in the catalog is appreciated! Even if it can't be integrated in my process. I need the contents cataloged ...
My custom content types are contained in the Plone Catalog Tool page selection field, but I don't know whether this is sufficient.
Edit 2:
Somehow my objects have been catalogued - the unrestrictedSearchResults method shows them! However, it can't be the desired solution to use this method all over; so I need to "un-restrict" the entries somehow.
It turned out that I have a monkey:patch (xmlns:monkey="http://namespaces.plone.org/monkey") for the Products.CMFPlone.CatalogTool.CatalogTool.searchResults method; this filters the catalog for my additional field subportal unless a special value for it is given - even in the management view ... Unfortunately, I had no way to specify this special value in that view.
Thus, the solution was to weed out all wrong values (for subportals which don't exist in the other Zope tree) to have the default value take effect.
Quite specific to my setup, I'm afraid ...
I need a help for while creating the collection the below error is came in server console.How to solve the error ?
Error:
Warning: creating anonymous collection. It will not be saved or synchronized over the network. (Pass null for the collection name to turn off this warning.)
TLDR: you need to provide a collection name as an argument when you create a shared collection.
In most cases, you want to provide a name as a parameter when you define a collection:
Docs = new Meteor.Collection('docs');
When you don't, you create anonymous collection:
Items = new Meteor.Collection();
In the first case, the collection is shared and synchronized between client and server, and the name you've provided is used as a table name in order to store the collection in Mongo.
Anonymous collections are local in the place they've been created. Their contents are never synchronized. Therefore, even if you create such collection in a piece of code that will be run on the server and on the client, those two collections will be separate things: data created on the server won't be visible on client, data created on the client won't be visible on server, and both won't be stored in the database.
There are legitimate use cases for anonymous collections, mostly on the client side when you need to create some temporary data, but want to retain all the benefits of Minimongo and reactivity. However, it's one of those things that are needed rarely and you really do know when you need to do it. It's more probable that a beginner made a mistake and forget to provide the collection name when he wanted to create a typical shared collection. Therefore, the system issues a warning to make sure that you really wanted to do what you just did.
Therefore:
If your goal was to create an anonymous collection, and you know what you're doing, don't worry about that message. It's just a warning, the code will be functional and do what it's told to.
If you wanted to create a normal collection, or are just starting out and don't know what's this all about, just add a parameter to your collection definition.
Is it possible to store instances of a class in a cookie or in shared objects.
Basically in my application I have an object "Diagram" that the user can create. If they hit save, I want to store the current instance as a cookie and allows them to reload it later.
Alternatively, I could see about getting them to store the saved version on the hard disk. But even then, all I want to save and retreive is my actionscript object.
Is this possible?
I've tried storing the object to SharedObject.data.diag, but when I try to retrieve the object from the cookie doing SharedObject.data.diag as Diag returns null.
http://www.oreilly.de/catalog/9780596529857/chapter/ch17.pdf
Page 10: Serialize typed objects.
You may have issues with deep cloning if you have a complex class.
I am using shared object to share data between two users. First user connect to shared object and set some value in shared object. Please consider that second user has not connected with the shared object yet.
Now when second user connects to the server and try to get that property set by first user, he could get shared object but could not get properties of Shared object set by first user. I observed few times that Second user can get these properties within "Sync" event between two users. But I would like to get these values for Second user in any stage (i.e. in load event etc.). Whenever Second user tries to get the property of Shared object, the object will reset the actual property value and then return reset value.
Anyone faced such issue while using shared object between two users. If so, I would appreciate if you could let me know your suggestions for following questions:
1) Is there any way to get all the properties of shared object before sync event called, as I want to get it immediately when second user connect to the application and perform next task based on the values stored in shared object.
2) Is it possible for second user to check whether any property has been set by first user? So that second user can use the property instead of reset it.
Give you a citation from adobe docs:
"The SharedObject class is used to read and store limited amounts of data on a user's computer or on a server.(...)To use remote shared objects, you need Adobe Flash Media Server"
Do you have a server that supports that technology?