ERXTolerantSaver Class Reference
List of all members.
|
Static Public Member Functions |
| static String | save (EOEditingContext ec, boolean writeAnyWay, boolean merge) |
| static String | save (EOEditingContext ec, boolean writeAnyWay) |
Static Public Attributes |
| static final Logger | log = Logger.getLogger(ERXTolerantSaver.class) |
Static Private Member Functions |
| static String | _save (EOEditingContext ec, boolean writeAnyWay, boolean merge) |
| static String | errorFromException (Exception e) |
Detailed Description
This class is pulled directly out of David Neumann's ChangeNotification framework. The only changes made are to use log4j instead of System.out.println.
The tolerant saver provides a way to save an editing context in a tolerant fashion. By tolerant we mean that you can have the option to save an editing context and have the exception ignored, hvae the changes merged from the database or stomp all the changes the database regardless of locking. The entry point for using this class is the
save method.
- Deprecated:
- use ERXEC
Member Function Documentation
| static String _save |
( |
EOEditingContext |
ec, |
|
|
boolean |
writeAnyWay, |
|
|
boolean |
merge | |
|
) |
| | [static, private] |
Entry point for saving an editing context in a tolerant manner. The two flags for this method are writeAnyWay and merge. The writeAnyWay flag controls if a second save should be performed if the first operation fails due to a general adaptor operation. Note that even if this option is specified as false the object will be refetched and optionally have the new changes merged into. This means that the objects that failed saving to the database will be ready to be saved if writeAnyWay is false. The second option is to merge the previous changes if a failure occurs. If this is set to true then when a locking failure occurs the object is refetched and then the previous changes are re-applied to the object.
- Parameters:
-
| ec | editing context to be saved |
| writeAnyWay | boolean flag to determine if an editing context should be saved again after a failure. |
| merge | boolean flag that determines if changes should be re-applied if a locking failure occurs when the first save happens |
- Returns:
- string indicating the exception that happened, null if everything went smooth. This should be changed in the future.
| static String errorFromException |
( |
Exception |
e |
) |
[static, private] |
| static String save |
( |
EOEditingContext |
ec, |
|
|
boolean |
writeAnyWay, |
|
|
boolean |
merge | |
|
) |
| | [static] |
| static String save |
( |
EOEditingContext |
ec, |
|
|
boolean |
writeAnyWay | |
|
) |
| | [static] |
Cover method for calling the method save with the third parameter (merge) set to true. See the description of the three parameter version for a detailed explanation.
- Parameters:
-
| ec | editing context to be saved. |
| writeAnyWay | boolean flag to determine if the editing context should be resaved after a general adaptor exception |
- Returns:
- string representation of the exception that happened. This will be changed in the future.
Member Data Documentation
final Logger log = Logger.getLogger(ERXTolerantSaver.class) [static] |
The documentation for this class was generated from the following file: