doctrine2: explicitly fetching without cache - zend-framework

I use doctrine2.2.2 with Zend Framework1 and am currently working on an editing tool.
A user clicks a link to move someting "up" in the list, my action does its work, changes are made to teh database, i redirect but then the result, newly fetched from the database is still the old version.
I would figure it has to do with cache since i am not temporarily storing the object in the session or anything.
So the Question is: Is there a way to fetch something and tell Doctrine, not to use the cache for this specific request? Or is there a possibility to delete certain cache entries?

Yep, take a look at http://readthedocs.org/docs/doctrine-orm/en/latest/reference/caching.html?highlight=cache#result-cache .
There is a query api to enable, disable, ... result cache for example, individuallty on each query; or globally.

Related

Setting a value in Frappe application isn't reflected in ERPNext GUI

I have added a 'number_of_members' value to the Customer DocType via customization.
In my application I have tried several ways to update the value. However the value never updates in the webpage. I feel like I'm missing some sort of save or update or commit step.
For example I have tried:
frappe.client.set_value('Customer', '00042', 'number_of_members', 8887)
frappe.set_value('Customer', '00042', 'number_of_members', 8887)
frappe.db.set_value('Customer', '00042', 'number_of_members', 8887)
and also
customer = frappe.get_doc('Customer', '00042')
customer.number_of_members = 8887
customer.save()
In each case I can do something like frappe.get_value, or frappe.get_doc and it shows the value is set to 8887. However it never updates in the web side. This is what makes me think I'm updating some sort of cache or database transaction and I need some way to save it, but have not had any luck.
I am mostly testing this via bench console if that has any bearing on it, but I've tried a couple of the methods in my application code as well.
Relevant documentation:
Frappe Developer API - Document
Frappe Developer API - Database
Turns out the answer is to call frappe.db.commit() after making changes. If someone can point this out in the documentation so I can better understand how I'm missing stuff, I would appreciate it.
I also noticed if you try to Save something in the UI before you send frappe.db.commit() the UI will hang.

Does CQ5 store modification list(history) of crx?

Sometime someone want to change inside something crx directly on environment.
Often it is a cause of unworking state of environment. And often enough hard to find the cause of the problem. And I think it is will be helpful if cq5 crx will have audit log. something like this.
12.12.12 21:03 /etc/blueprints/geometrixx was removed [rollout]
...
maybe CQ5 has something like this already?
Assuming these changes to the repositories are made using crxde lite[/crx/de/index.jsp] or content explorer [/crx/explorer/browser/index.jsp] , there is an indirect way to find out who did it.
The data can be fetched by looking into two different logs request.log and audit.log [these files can be found at \crx-quickstart\logs folder ]
The modifications to nodes are POST requests. These are logged in request.log , the path of the request will only show the interface used or to root node. If you search the time stamp of the POST in audit.log you can find which user did a GET request.
This is not direct way, nor will it tell more of the changes except for which user read the node at the time of the POST .

When I try to add a schema in stackmob it is not getting saved

I was trying to do a tutorial in stackmob but while I try to save a schema and when I come back to it I cant find the changes I made to the schema?Any help??
Assuming you mean that you are in the Stackmob Dashboard and trying to create and save a schema, there are two snags that can get you (and me). If you didn't hit save schema, nothing will be saved. The other snag can be that you do not set the Create, Read, Update, and Delete permissions at the bottom of the page, although I think it flags this as something you must complete. If these things have been done and your data is not being retained, provide a bit more info and I can try my best to help.

csv, xml, etc import in a restful way

We are in the proces of adding our data import functionality to our RESTful interface.
We are trying to come up with a RESTful way to handle this proces.
From a user perspective we have the following proces:
(1) The user uploads a file (2) the user selects some configuration options that control how the data is entered into the system and the system presents a preview of the result (the user can change the settings untill satisfied) (3) once the user confirms everything is correct the import is executed. This results in new elements being created in the /participants resource.
Currently we upload the data to a /imports resource on step 1. Everytime the user changes the import configuration we save the new configuration to the resource and get back a new preview. We have a differenco of opinion about what the "go ahead and process the input" action should look like and whether it should be posted to the /import or /participants resource.
We are not completely happy with the amount of actions we need to get this going but we cant change the user scenario for functional reasons.
What would be the most restful way of dealing with the "go ahead and process the import" stage (it feels SOAP'y) or how can we change this if necessary?
You uploaded an "import" so you should "process" that import.
Perhaps something like:
POST /import/<id>/process
To this, you would return a status code of 202 Accepted since you'll be actually creating something else

How to show previous url after user has canceled dialog with message from Activity#mayStop()?

In our app we need to check if the data is saved when we are in a particular place before navigating away from it. So the user should be able to negate a browser back button request. But by the time that the history value change event is received the url has already been changed. The History class doesn't seem to have a way to restore the url back. Anybody have any ideas?
In GWT 2.1 you get Activities and Places. And activity has a maystop method, which is exactly what you want, if I understand you correctly.
Use a window.onunload or window.onbeforeunload javascript callback to confrim/save state.
onbeforeunload example
I haven't actually implemented this behavior yet, but here is my plan and maybe it will work for you.
1) Each time you receive an onHistoryChanged event and decide to allow it, save the current historyToken in an instance variable somewhere.
2) Keep track of activity on the page that should block navigation. Use a data structure that can keep track of multiple activities, like multiple file uploads, multiple edits, etc.
3) When you receive a new onHistoryChanged event, if your data structure from #2 indicates that it's not safe to navigate, avoid changing the page and restore the historyToken that you saved in #1. I'm assuming that you can do this either by:
a) Calling History.newItem(oldHistoryToken, false) or
b) Calling History.newItem(oldHistoryToken, true) and keeping a flag to force the next onHistoryChanged to be ignored.
Again, I haven't actually implemented this so let me know how it works out.
If you have links that allow the user to leave the app and you want to prevent that as well, you'll need to also add an onbeforeunload.
Have a look at the PlaceManagerImpl class from the gwt-platform framework. Especially the onValueChange() method and the methods dealing with the onLeaveQuestion field.
Hope that helps.
In this issue report, t.broyer explains in his comment that such behavior was planned during design of Places framework. The most important part is:
mayStop was a mistake, or it should have only been called when unloading the app, not for internal navigation within the app.
So probably it's better to not use it at all...