Changes for page Database Compatibility and Comparisons-OpenBase
Last modified by Pascal Robert on 2007/09/03 21:02
From version 6.1
edited by Pascal Robert
on 2007/09/03 21:02
on 2007/09/03 21:02
Change comment:
There is no comment for this version
To version 5.1
edited by smmccraw
on 2007/07/08 09:44
on 2007/07/08 09:44
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 -Database Compatibility and Comparisons-OpenBase 1 +Programming__WebObjects-Database Compatibility and Comparisons-OpenBase - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. probert1 +XWiki.smmccraw - Content
-
... ... @@ -1,46 +1,48 @@ 1 -== Overview == 1 +== Overview == 2 2 3 -== Performance == 3 +== Performance == 4 4 5 - [[http://www.codefab.com/wordpress/index.php/2006/02/11/webobjectseof-patch-better-way-to-limit-fetches-with-openbase/]]5 +http:~/~/www.codefab.com/wordpress/index.php/2006/02/11/webobjectseof-patch-better-way-to-limit-fetches-with-openbase/ 6 6 7 - == Deadlocks==7 +Category:WebObjects 8 8 9 - Whenwriting high volumes of data over multiple tables from a WebObjects system, it is possible to create adeadlock. OpenBaseresolvesthe deadlock condition by aborting one of the transactions and returning an error to the WebObjects application.9 +== Deadlocks == 10 10 11 - Apossiblesolutionto thisproblemistoidentifythe tablestowritetoimmediatelyafteropeninga transaction.ThenecessarySQLwouldlooksomethinglike this.11 +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. 12 12 13 +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. 14 + 13 13 {{code}} 14 14 15 -START TRANSACTION 16 -WRITE TABLE foo, bar 17 -INSERT INTO foo... 18 -INSERT INTO bar... 19 -COMMIT 17 +START TRANSACTION 18 +WRITE TABLE foo, bar 19 +INSERT INTO foo... 20 +INSERT INTO bar... 21 +COMMIT 20 20 21 21 {{/code}} 22 22 23 -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...25 +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... 24 24 25 25 {{code}} 26 26 27 -/Library/Frameworks/JavaOPENBASEJDBCAdaptor.framework 29 +/Library/Frameworks/JavaOPENBASEJDBCAdaptor.framework 28 28 29 29 {{/code}} 30 30 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. 33 +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 34 +get this adaptor to work with your model. 33 33 34 34 {{code}} 35 35 36 -EOModel model = EOModelGroup.defaultGroup().modelNamed("MyModel"); 37 -if(null!=model) 38 -model.setAdaptorName("OPENBASEJDBC"); 38 +EOModel model = EOModelGroup.defaultGroup().modelNamed("MyModel"); 39 +if(null!=model) 40 +model.setAdaptorName("OPENBASEJDBC"); 39 39 40 40 {{/code}} 41 41 42 -This code will locate the framework for the adaptor, load the adaptor as well as set the adaptor in 43 -the model. If you are using SQL logging from EOF, the WRITE TABLE... clauses will be written 44 +This code will locate the framework for the adaptor, load the adaptor as well as set the adaptor in 45 +the model. If you are using SQL logging from EOF, the WRITE TABLE... clauses will be written 44 44 to the log as well. 45 45 46 46 There is no need to include the LEWOStuff framework in your project if you are going to use this one.