prevayler / prevayler Goto Github PK
View Code? Open in Web Editor NEWPrevayler
Home Page: http://www.prevayler.org/
License: Other
Prevayler
Home Page: http://www.prevayler.org/
License: Other
=============================================== PREVAYLER (TM) The Free Software Prevalence Layer for Java =============================================== Prevalence is the simplest, fastest and most transparent architecture for business object persistence, load-balancing and fault-tolerance. Prevayler is the original free software prevalence layer implementation for Java. Free Software License ========================= The Prevayler library is free software, distributed under a BSD license. See LICENSE.TXT in this directory for more details. Features ============ Prevayler implements ACID transactions and transparent business object persistence. It does not yet implement replication, which will enable load-balancing and fault-tolerance. Performance Scalability =========================== 10000 (ten thousand) times faster than Oracle. 3000 (three thousand) times faster than MySQL. These are typical results for the Prevayler query scalability test running against DBMSs using JDBC, even when the DBMSs use local databases fully cached in RAM. You can compile and run the test for yourself. Its source code is available for inspection in the "demos/scalability" directory starting at: org.prevayler.demos.scalability.Main It runs transaction-processing and query scalability tests against Prevayler and any JDBC database. Just follow the instructions displayed on the console. Required Java Platform ========================== Prevayler 2.5 and below is written against the APIs of the Java 2 Platform Standard Edition version 1.4. Prior to Prevayler 2.5 the output classes are targeting Java 1.4, while Prevayler 2.5 targets Java 1.6. As of Prevayler 2.6 both code and compiled output will target Java 1.6. Running Prevayler ===================== Prevayler is a prevalence framework. It is compiled in the "prevayler-XYZ-N.N.jar" files available in this distribution. * prevayler-core-${version}.jar * prevayler-factory-${version}.jar The core and factory modules are required for basic Prevayler operation. Using these two alone does not introduce any external dependencies. * prevayler-xstream-${version}.jar The xstream module is an optional extension for using XML for journal and snapshot serialization, requiring the external XStream library. * prevayler-log4j-${version}.jar The log4j module is an optional extension implementing Prevayler's Monitor interface using Log4J. It naturally requires Log4J. * prevayler-mirror-${version}.jar The mirror module is an experimental extension implementing simple master-slave replication. It is not yet very robust, but some users are already using it. To run Prevayler, you must write an application of your own or use the following demo applications. Demo Applications ===================== The Prevayler demo applications are available in the "demos" directory. They have the main() method and can be compiled and run directly. * demos/demo1: org.prevayler.demos.demo1.Main A tiny application that finds prime numbers and stores them using Prevayler. * demos/jxpath: org.prevayler.demos.jxpath.Main An example of using JXPath to query Java objects. See demos/jxpath/README for more details. * demos/tutorial: org.prevayler.tutorial.Main A very simple quick-start example. * demos/scalability: org.prevayler.demos.scalability.Main Mentioned previously. Learning Prevayler 1-2-3 ============================ The prevalence concepts are ridiculously simple. Unlike using a database, though, writing an application using a prevalence layer actually requires you to know OO. 1. Read the "Object Prevalence Skeptical FAQ" in the "docs" directory. 2. Run the demos above and understand their source code. Use the javadoc in the "apidocs" directory as a reference. 3. Write a little application of your own using the Bank demo as an example. The source code to Prevayler is available in the "src" directory. You are dearly invited to visit it. The core Prevayler implementation is only a couple thousand lines of code. Prevayler Pet Store ======================= A more elaborate Prevayler tutorial including a web interface (JSP) can be found at: http://sourceforge.net/projects/presto Contact Information ======================= All Prevayler resources are available from: http://www.prevayler.org/ If you know Java but have any trouble or doubt running Prevayler, please join our discussion lists. Ideas, contributions and suggestions are welcome too. Thanks, The Prevayler team. ---------------------------------------------------- Copyright 2001-2011 by Klaus Wuestefeld and the Prevayler team "PREVAYLER" is a trademark of Klaus Wuestefeld.
This is spun out from pull request #9 in order to discuss design options.
Background
Currently, Prevayler prefers durability by default: Every transaction is synced to disk* and executed before prevayler.execute(transaction)
returns to the caller. Transactions that are submitted concurrently from multiple threads may be written to disk with a single sync, which is a huge throughput win, without sacrificing durability, for applications that are handling many concurrent requests.
* To be precise, we call FileChannel.force(false)
in order to ensure that the JVM has asked the OS to flush the data buffer to the underlying storage. Whether the OS call actually results in the bits landing on the physical medium is out of our hands.
As a concession for those applications that want higher throughput but aren't handling many concurrent requests, Prevayler also provides a journalDiskSync
flag, which can be set to false
in order to suppress the OS-level file sync call altogether. Transactions are still written to the FileOutputStream before returning, which will eventually be flushed to the OS as long as the process doesn't crash before it has a chance.
Feature Request
Some applications really want something in between: Execute a series of transactions with a forced sync at the end of the series. If the whole series of transactions is known up-front, they can already be composed together into a single transaction fairly easily without any change to Prevayler, but if the application needs to do some processing after each transaction to determine the next one, we don't have a good answer yet. We are interested in providing a clean way to force a disk sync after such a series of non-synced transactions. This could mean either merely augmenting or completely replacing the existing journalDiskSync
flag implementation.
I encountered an error with org.prevayler.foundation.ObjectInputStreamWithClassLoader
, that is when you pass a class loader, it can't resolve primitive types anymore. Looking at the implementation of super.resolveClass(v)
, there's a try-catch block handling primitive types:
protected Class<?> resolveClass(ObjectStreamClass desc)
throws IOException, ClassNotFoundException
{
String name = desc.getName();
try {
return Class.forName(name, false, latestUserDefinedLoader());
} catch (ClassNotFoundException ex) {
Class<?> cl = primClasses.get(name);
if (cl != null) {
return cl;
} else {
throw ex;
}
}
}
This try-catch block should also be present in the overridden method.
...but I am seeing commit activity here up to 2020. A release hasn't been made in...seven years? Feels like something is off.
Website: https://prevayler.org
Commits: https://github.com/prevayler/prevayler/commits/master
It looks like MicroStream, an Eclipse foundation project, is taking the torch from Prevayler and getting some use and popularity. It would be interesting to compare the projects, perhaps join efforts.
I saw this test fail one time in Travis CI. Looking at the code, it looks like it will fail any time that it takes less than 1ms to replay the journal, because then the timestamps match even when the transaction doesn't use the proper executionTime value.
I have a very old project using prevayler 2.6. Everything works on Java 8.
Updating to Java 11 and reading previous snapshots throws StreamCorruptedException: invalid type code (the actual code changes). So far this only happens with one class BaseUser - a super class of the actual class being deserialized - SiteUser.
Data types of the fields are List, String, and byte[] - Group data types are String and List
I have not seen this error before and don't have experience debugging serialization (I didn't write this project) so any tips on where to start would be greatly appreciated.
java.lang.RuntimeException: java.lang.RuntimeException: java.io.StreamCorruptedException: invalid type code: 86
at net.firelord.phoenix.server.Server.start(Server.java:148)
at org.tanukisoftware.wrapper.WrapperManager$11.run(WrapperManager.java:4146)
Caused by: java.lang.RuntimeException: java.io.StreamCorruptedException: invalid type code: 86
at net.firelord.phoenix.servlet.Hosted.contextInitialized(Hosted.java:94)
at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:959)
at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:553)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:924)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:365)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:854)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:278)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:167)
at org.eclipse.jetty.server.Server.start(Server.java:418)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:382)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at net.firelord.phoenix.server.Server.start(Server.java:143)
... 1 common frames omitted
Caused by: java.io.StreamCorruptedException: invalid type code: 86
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1622)
at java.base/java.io.ObjectInputStream.readArray(ObjectInputStream.java:1968)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1588)
at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2355)
at java.base/java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:566)
at net.firelord.user.BaseUser.readObject(BaseUser.java:155)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1160)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2216)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594)
at java.base/java.io.ObjectInputStream$GetFieldImpl.readFields(ObjectInputStream.java:2534)
at java.base/java.io.ObjectInputStream.readFields(ObjectInputStream.java:610)
at net.firelord.phoenix.component.ComponentImpl.readObject(ComponentImpl.java:604)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1160)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2216)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:430)
at java.base/java.util.HashMap.readObject(HashMap.java:1460)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1160)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2216)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594)
at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2355)
at java.base/java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:566)
at net.firelord.persistence.ObjectStore.readObject(ObjectStore.java:213)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1160)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2216)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2087)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1594)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:430)
at net.firelord.phoenix.core.persistence.ContainerAwareSerializer.readObject(ContainerAwareSerializer.java:55)
at org.prevayler.implementation.snapshot.GenericSnapshotManager.readSnapshot(GenericSnapshotManager.java:100)
at org.prevayler.implementation.snapshot.GenericSnapshotManager.<init>(GenericSnapshotManager.java:43)
at org.prevayler.PrevaylerFactory.snapshotManager(PrevaylerFactory.java:364)
at org.prevayler.PrevaylerFactory.create(PrevaylerFactory.java:316)
at net.firelord.phoenix.servlet.Hosted.initializeSystem(Hosted.java:222)
at net.firelord.phoenix.servlet.Hosted.prepare(Hosted.java:285)
at net.firelord.phoenix.servlet.Hosted.contextInitialized(Hosted.java:90)
... 18 common frames omitted
Log4j 1.2.x contains a vulnerability of moderate severity. See the automated alert that we received for more details. We only use it in our extras/log4j module. Since Log4j 1 is out of support, the only remediation is to upgrade to Log4j 2. The latest release that is still compatible with Java 6 is Log4j 2.3.
Why does our pom.xml declare org.sonatype.oss:oss-parent:7 as its parent? This source says oss-parent
is deprecated, but there are later releases available in Maven Central. We could either upgrade to a later version, or copy what we need out of it into our own top-level pom.xml
.
I manage several open source projects where we use Prevailer for persistence management. These projects now use Docker and volume mapping. What is the best way to keep several running instances (scaling, several containers on multiple hosts) in sync using Prevailer?
Actually we nail the maximum container count per app down to one which is not satisfying (no scaling).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.