is an interesting tool that allows you to manage a tree of Java objects persistently. It's basically a combination of Java serialization and the Command pattern. All changes to the "database" must be in the form of Command objects that can be serialized and then called to perform their changes.
Prevayler is controversial because of their hype-filled site, and their claims about how much faster they are than a relational database. In the end, it turns out that prevayler is designed for working with small datasets that can fit in memory. It's not as scalable as a relational database, nor is it as "open" since people can't hook up to it and send arbitrary SQL commands. It's nice solution for cases where an RDBMS is overkill for working with a small data set.
Prevayler's javadoc blows. Why don't open source hackers document their code?
Prevayler (see PrevaylerImpl constructor) first tries to recover the dataset from a snapshot (see the snapshot manager) and then recovers transactions from the journal. It does this by adding itself (an inner class) as a subscriber to the publisher. The publisher calls the journal which reads and replays any transactions that are in the journal since the checkpoint.
- User calls
PrevaylerImpl wraps the transaction in a
Capsule then calls
publish() locks out subscribers
- checks that the transaction is OK using the
- appends the transaction to the journal
- notifies all subscribers, i.e. calls
receive(TransactionTimestamp) on each one.
You need to manually tell prevayler to snapshot itself by calling
Lots of them.
The process of "subscribing" a TransactionListener brings it up to date with the transaction journal. During that time transactions are blocked and vice versa (see
Transactions are applied to the database one at a time (see
- since Prevayler rests on Java serialization it's a good idea to learn as much as you can about it.
Copyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding The Caboteria? Send feedback