WebObjects/Database Compatibility and Comparisons/OpenBase

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Overview[edit | edit source]

Performance[edit | edit source]


Deadlocks[edit | edit source]

When writing high volumes of data over multiple tables from a WebObjects system, it is possible to create a deadlock. OpenBase resolves the deadlock condition by aborting one of the transactions and returning an error to the WebObjects application.

A possible solution to this problem is to identify the tables to write to immediately after opening a transaction. The necessary SQL would look something like this.

WRITE TABLE foo, bar 

Supplied with LEWOStuff (http://www.lindesay.co.nz/) is a framework called JavaOPENBASEJDBCAdaptor. This framework is able to place these locks after each EOF generated transaction is started in order to prevent deadlocks from occurring. You need to copy the framework build product into your local library folder. Under MacOS-X this would be...


You then need to add this framework to the Frameworks grouping within your X-Code WO project. In your WebObjects "Application" subclass constructor, insert some code of the following form to get this adaptor to work with your model.

EOModel model = EOModelGroup.defaultGroup().modelNamed("MyModel"); 

This code will locate the framework for the adaptor, load the adaptor as well as set the adaptor in the model. If you are using SQL logging from EOF, the WRITE TABLE... clauses will be written to the log as well.

There is no need to include the LEWOStuff framework in your project if you are going to use this one.