cancel
Showing results for 
Search instead for 
Did you mean: 

Short-lived persistence

antonylees
Champ in-the-making
Champ in-the-making
Hi all

I want to use activiti for short-lived workflow, similar to the way the HTTP session works in a web app, so I don't really need the persistence.  I had the thought that I could use an in-memory database and clear it out at end of the process (perhaps as a listener on end end event), but is there a way to do this already?

Antony
9 REPLIES 9

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
This forum has a search option that probably would provide a result. But there is one http://lmgtfy.com/?q=activiti+memory+database

😉

antonylees
Champ in-the-making
Champ in-the-making
Yeah, that's really helpful thanks  :?

There is a quesation about using an in-memory database, but that isn't my question.  My question is about not persisting the data - an in-memory database will still keep the data in-memory.  I don't want to do that, I only want the data to live for the life of the process.  I could write a listener to listen for end tasks and clear the data out myself using JDBC.  But does activiti provide this functionality already?

I did try searching first and didn't find the answer.  If anyone has any actually helpful answers, please let me know

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Sorry, I did not know you knew that an in-memory db was an option. I misread your question (I'm not a native English speaker)

There is currently not another option to achieve this. Then you'd be rewriting the persistence layer to exchange the in-memory db with an in-memory object list/map/… since the flow needs state. I think the work that needs to be put in there does not outweigh the slight advantage in performance. So using an in-memory db would be my suggestion.

antonylees
Champ in-the-making
Champ in-the-making
Hmmm, ok, shame.  It looks like Drools Flow has this option but I do really like Activiti and, as the JVM might be running for a long time, I don't really want to create an ever expanding database/file

I'll have a  look into the listener option - it seems like a fairly simple option

antonylees
Champ in-the-making
Champ in-the-making
Actually, re-reading your reply, I think you misunderstood me again

Using an in-memory database is fine, though the option not to (as with Drools Flow) would be nice.  What I want is to not store the process data after it has ended

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Take a look at this:

http://www.activiti.org/userguide/index.html#historyConfiguration

'none' will do exactely what you want.

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
if I understood you correctly this time 🙂

antonylees
Champ in-the-making
Champ in-the-making
I just tried it and yes, that is exactly what I want

What I hadn't realised is that the current execution ID is removed from the runtime tables and moved to the history tables when the process ends.  Ideal

Many thanks  Smiley Happy

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
it's not even a move as far as I know. The history table is always 'up to date' with th runtime tables (if history is enabled)