Last modified by Pascal Robert on 2007/09/03 21:02

Hide last authors
Pascal Robert 6.1 1 == Overview ==
Pascal Robert 2.1 2
Pascal Robert 6.1 3 == Performance ==
Pascal Robert 2.1 4
Pascal Robert 7.1 5 [[http:~~/~~/www.codefab.com/wordpress/index.php/2006/02/11/webobjectseof-patch-better-way-to-limit-fetches-with-openbase/>>url:http://www.codefab.com/wordpress/index.php/2006/02/11/webobjectseof-patch-better-way-to-limit-fetches-with-openbase/||shape="rect"]]
Pascal Robert 2.1 6
Pascal Robert 6.1 7 == Deadlocks ==
Pascal Robert 2.1 8
Pascal Robert 7.1 9 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.
Pascal Robert 2.1 10
Pascal Robert 6.1 11 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.
Pascal Robert 2.1 12
13 {{code}}
14
Pascal Robert 6.1 15 START TRANSACTION
16 WRITE TABLE foo, bar
17 INSERT INTO foo...
18 INSERT INTO bar...
19 COMMIT
Pascal Robert 2.1 20
21 {{/code}}
22
Pascal Robert 7.1 23 Supplied with LEWOStuff ([[http:~~/~~/www.lindesay.co.nz/>>url:http://www.lindesay.co.nz/||shape="rect"]]) 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...
Pascal Robert 2.1 24
25 {{code}}
26
Pascal Robert 6.1 27 /Library/Frameworks/JavaOPENBASEJDBCAdaptor.framework
Pascal Robert 2.1 28
29 {{/code}}
30
Pascal Robert 7.1 31 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
32 get this adaptor to work with your model.
Pascal Robert 2.1 33
34 {{code}}
35
Pascal Robert 6.1 36 EOModel model = EOModelGroup.defaultGroup().modelNamed("MyModel");
37 if(null!=model)
38 model.setAdaptorName("OPENBASEJDBC");
Pascal Robert 2.1 39
40 {{/code}}
41
Pascal Robert 6.1 42 This code will locate the framework for the adaptor, load the adaptor as well as set the adaptor in
Pascal Robert 7.1 43 the model. If you are using SQL logging from EOF, the WRITE TABLE... clauses will be written
44 to the log as well.
Pascal Robert 2.1 45
46 There is no need to include the LEWOStuff framework in your project if you are going to use this one.