User Tips
- In any long-running application, open the desired database on startup and leave it open until shutdown. This prevents startup and shutdown of the database for each connection, which slows down your application. Once the database has been started, additional connections in embedded mode are very low cost and can be opened and closed freely.
- Avoid sharing database connections (i.e. JDBC connections and DatabaseImpl instances), specially in embedded mode. The cost of opening new Database connections is small, and easily worth it as it minimizes contention issues.
- Ensure shutdown happens every time - otherwise restart/recovery could take some time. The larger the tables that have not been saved, the longer recovery will take.
- Leaving a connection to the database open will hang your appliction on exit. Use the finally clause to ensure you always disconnect any open database connections.
- Use SERIALIZABLE transaction isolation only when absolutely required, since DataCaster does not allow any concurrency for SERIALIZABLE write transactions on the same table, i.e. a SERIALIZABLE transaction will lock out all other transactions writing to the same table.
- Use the default READ_COMMITED transaction isolation level whenever possible, since it prevents blocking of read transactions, except for a few very direct conflicts at the tuple-level or index page.
- The API is not well suited to unmaterialized views. Often the data is materialized for each user, so it is advisable to do queries on views (which reduce teh data) to use unmaterialized views that result in large data sets.