I'm implementing record versioning using OrientDB, but its callback seems to be invoked right after OOBjectDatabaseTx#save(Object) is called.
Is there any way to get an additional callback for persisted record?
It turned out that we can use ODatabaseListener for this purpose
Related
I'm making a Flutter SIP call application using dart-sip-ua https://github.com/flutter-webrtc/dart-sip-ua.
I need to use PUSH messages to wake up the application and set the call.
I was able to wake up the application, but how to connect with the current call?
According to the documentation, when making a call, a Call object is created and it has an answer() method.
But when the Call object wakes up, we do not have, respectively, the answer() method either.
I tried to find a solution using SIPUAHelper.findCall(callUUID), but without success: callUUID is generated when the call is initialized, and we do not know it in advance to pass it via PUSH.
That is, I show my CallScreen, but I don’t have a Call object...
Is there really only one option? Wait until the SIP connects itself? It could be 5, 10, 30 seconds...
Help me please. What is the approach to accomplish this task? I feel that my approach is not correct.
Thank you!
One possible solution to your problem could be to store the Call object in a persistent storage, such as a database or a file, whenever it is created. Then, when the application wakes up and receives the PUSH message, you can retrieve the Call object from the storage and pass it to the CallScreen. To do this, you can use a database library like "sqflite" or a file library like "path_provider" to store and retrieve the Call object as a serialized object.
Another option could be to use the "callUUID" of the Call object as a key to store and retrieve it from the storage. You can pass the "callUUID" via PUSH message, and use it to retrieve the Call object from the storage. However, you need to make sure that the "callUUID" is unique and persistent across sessions, so you may need to use a combination of the SIP call ID and the local session ID.
A third option could be to use a global state manager like "Provider" or "Redux" to store the Call object and share it across the application. This way, you can access the Call object from any widget, even if it is not passed directly as an argument. However, you need to be careful with the performance and complexity of using a global state manager, especially if you have a large and complex application.
I hope these suggestions can help you solve your problem
I am using Axon 3.1.1 and wanted to know,
How can I get a list of eventprocessor in my configuration file,
I went through the springAmQPmessageSource file but still not sure how to exactly do it.
So that I can pass my event to appropriate eventhandler on Query side.
List<Consumer<List<? extends EventMessage<?>>>> eventProcessors = new CopyOnWriteArrayList<>();
Updated
I was retrieving message from kafka topic and wanted to wire them to specific eventhandler but since I am not able to get evenprocessors, I am not able to do that.
Can you please tell me how to do it, if I am using Axon 3.0.5
If you're using the SpringAmqpMessageSource, you will not need to retrieve the list of eventProcessors you've shared, as Axon will automatically subscribe all the event handling components to it for you.
Subsequently, the events the Message Source receives will automatically be pushed to all the listeners in your query side.
As this is all covered as Axon infrastructure under the hood, there is no one-off way to pull them out of it for your own use (other than potentially wiring them yourself).
Hence, you shouldn't have to do this yourself.
But, maybe I'm missing an obvious point here.
Could you elaborate a little more why you need the list of handlers in the first place?
I have some code which encrypts and decrypts data using EF POCO. To implement this I intercepted the Saving Changes and ObjectMaterialized events and it works (most of the time).
The issue I have is if I try to read back the encrypted object straight after saving the object the materialized event does'nt fire as it not going back to the DB to retrieve the record and therefore fails to fire the event.
Does anyone have any thoughts on how I could improve my approach to cover off this situation ?
i need help with logging Zend Framewrok application ( version 1.11 ), every request..
I need to know time of beinning request and time of executing request. Each request i would like to save into database, but i'm not sure, where i would catch these informations.
Beggining of request i can probably catch in bootstrap.php via some _init method. But in which place should I cach information about end of execution request, if i need to be connected into database? In addition i'm using $this->_redirector->gotoSimpleAndExit() in my controllers and i need count with that case - no view is rendered and request is finished simply by exit() function.
I would like to write log information only once per request.
Thank's for help!
Registration of shut down function helped very well.
http://php.net/manual/en/function.register-shutdown-function.php
I created custom logger (singleton pattern), that i'm calling in bootstrap.. since php 5.4 is available $_SERVER['REQUEST_TIME_FLOAT']. Logger register his method as shutdown function in constructor and also call it in his destructor. Multiple calling of shutdown function is prevented.
This solution is working even if exit() function is called.
For one of my projects, I'm putting the "end of execution" logging code in my layout script. It's supposed to be one of the "last" things to be executed.
I'm not using redirections for this project, though. So, I'm not sure how it should be extended to consider your "gotoSimpleAndExit()" case.
Hope that helps,
You can easily use the PropertyChanges events to set the flag. But how do you easily reset it after a save to the ObjectContext?
what about the ObjectContext.SavingChanges event? See also http://www.thedatafarm.com/blog/2008/07/13/OverridingObjectContextSaveChanges.aspx.
The above method calls for using the SavingChanges event which is called before the changes are persisted. If there is an error during the save, you have already cleared your dirty flag. I would think there would be a SavedChanges event exposed as well.