To edit or add content to this Wiki, you can simply create a new account at http://wocommunity.org/account.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Overview

Performance

http://www.codefab.com/wordpress/index.php/2006/02/11/webobjectseof-patch-better-way-to-limit-fetches-with-openbase/

Deadlocks

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.

Code Block
START TRANSACTION
WRITE TABLE foo, bar
INSERT INTO foo...
INSERT INTO bar...
COMMIT

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 occuring. You need to copy the framework build product into your local library folder. Under MacOS-X this would be...

Code Block
/Library/Frameworks/JavaOPENBASEJDBCAdaptor.framework

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.

Code Block
EOModel model = EOModelGroup.defaultGroup().modelNamed("MyModel");
if(null!=model)
model.setAdaptorName("OPENBASEJDBC");

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.