Issue #2855: Catching exceptions from online backup

Type: Feature RequestVersion: 2.8.8Priority: NormalStatus: FixedReplies: 10
#1

Hello,

I have a request for improvement in the area of backuping.

For catching the exceptions during online backups, I am using the solution suggested in the post 2786

Well not exactly, because there is written to use Thread.setDefaultUncaughtExceptionHandler() which is a global handler for all threads of the JVM and it is already used for other purpose in our app, so we are using the following solution:

Thread backupThread = backupQuery.getSingleResult();
backupThread.setUncaughtExceptionHandler((t, e) -> {
    // handle the exception in the way we would like
});
            
// Wait until the backup is completed.
try {
    backupThread.join();
} catch (InterruptedException e) {
    e.printStackTrace();
}

But it does not work well. For small database files in cases the exception is risen in the beginning of the backup process, then the backupThread finished its work even before our code would set the exception handler on the backupThread object.

So we lose the exception and our backup process acts as it would have run fine.

However the backupThread object has the exception stored in itself in field 'a', like u can see on the attached screen.

So my suggestion is that You could either make this field accessible via some API or the 

TypedQuery.getSingleResult()

would accept a parameter of type 

UncaughtExceptionHandler

which would be set on the executing thread before the execution starts.

That way we would not lose the exceptions in the beginning of the backuping.

 

#2

Does the setUncaughtExceptionHandler solution currently work also in client-server mode (when it is not an immediate exception)?

Maybe a query hint to disable starting the threads automatically will be a more flexible extension? i.e. your application will call Thread's start when ready after setting the Thread object?

ObjectDB Support
#3

Yes, the

setUncaughtExceptionHandler

method works in client-server mode. The query hint to disable automatic starting of the backup thread would be nice solution for us.

#4

Please check build 2.8.9_02 with something like:

    TypedQuery<Thread> backupQuery =
        em.createQuery("objectdb backup", Thread.class);
    backupQuery.setParameter("start", false);
    Thread backupThread = backupQuery.getSingleResult();
    // TODO: Complete initializing the thread.
    backupThread.start();
    backupThread.join();
ObjectDB Support
#5

I tested the improvement and the delayed starting is working. However if the file which I set in the target attribute, is not accessible for the app, a UserException is risen, but it is caught in the TOL.run() method instead of letting the 

UncaughtExceptionHandler

to catch it.

There is some handling of the exception like writing it into the log file with trace level, which is in fact making it invisible and then the exception is ignored. The backup query ends successfully although there was an Exception in it. I attached a screenshot from the debugger.

 

#6

Please try build 2.8.9_03.

ObjectDB Support
#7

I tried the new build. It did not help. You've added these 2 lines to the catch block in TOL:58 as shown on the attached screen:

this.a().a("tool").f(var3);
throw new InternalException(var4);

But this catch block is not reached as the exception is caught in the surrounding catch block in TOL:47 and its code does not generate next exception.

It would suggest moving the

throw new InternalException(var4);

to the finally block instead of the inner catch block.

 

#8

Maybe the catch block is executed but there is an unexpected exception in that catch block. In addition, there is already an internal mechanism of transferring the exception to another thread, which may interfere with what you are doing. .result {padding : 2px 4px 0 4px;} .top-row td { height : 3px; overflow : hidden; } .title-td, .title-tdCorp { font-family : expression(document.body.style.fontFamily); font-size : expression(document.body.style.fontSize); white-space : nowrap; border-bottom : 1px solid #c6ced3; background : #fffef2; } .top-border { border-top : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; height : 4px; } .right-border { border-right : 1px solid #c6ced3; border-bottom : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; width : 4px; } .left-border { border-left : 1px solid #c6ced3; border-bottom : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; width : 4px; } .header { background-color : #FFFEF2; border : solid #C6CED3; border-width : 1px 0; height : 25px; overflow : hidden; margin : 0 2px; } .title { float : left; margin : 4px 0 0 4px; font-weight : bold; } .gloss-btn .BAB_ImageBtn { margin : 0 4px; width : 8px; height : 8px; } .buttons{ margin : -1px -1px 0; float : right; } .buttons img { cursor : pointer; margin : 0; } .term { clear : both; margin : 8px 10px 2px 10px; font-weight : bold; } .definition { margin : 0 10px 6px 10px; } .BAB_CPBodyStyleLocal .definition br {line-height : 50%;} .BAB_CPBodyStyleLocal .definition p {margin : 5px 0; padding : 0;} .BAB_CPBodyStyleLocal .definition dl {margin-top : 2px; margin-bottom : 4px;} .BAB_CPBodyStyleLocal .definition ul { margin : 2px 0 2px 18px; } .BAB_CPBodyStyleLocal .definition ol { margin : 2px 0 2px 32px; } .BAB_CPBodyStyleLocal .definition td { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); } .hr { height : 1px; overflow : hidden; background-color : #C6CED3; margin-bottom : 6px; } .copyright{margin-bottom : 8px; font-size:80%;} .copyright br {line-height : 0;} .prcTrial { margin-bottom : 4px; font-family : Arial; } .prcTrial-body { font-size: 11px; background-color : white; border : solid #C6CED3; border-width : 1px 0; height : 55px; overflow : hidden; padding : 2px 8px; color : #009; } .prcTrial-body img { height: 32px; width: 32px; margin-top : 2px; float : left; } .days-left { font-weight : bold; color : #009; text-align: left; white-space: nowrap; direction:ltr; } .left-corner{position : absolute; left : 3px;} .right-corner{position : absolute; right : -5px; padding-right: 8px; background:expression(document.body.style.backgroundColor);} .expired { font-weight : bold; color : #FF0024; white-space: nowrap; } .buy-link { display : block; color : #009; margin-top : 20px; float : left; text-decoration : none; direction:ltr; } .no-line{text-decoration : underline;} .remove-gloss { display : block; color : #009; float : right; margin-top : 20px; } .non-wrapping,.non-wrapping td { white-space : nowrap; } /* Sentence translation */ .full-text { padding: 0; border-left: 1px solid #c6ced3; border-right: 1px solid #c6ced3; border-bottom: 1px solid #c6ced3; overflow: hidden; width: 100%; margin: 0 -2pt; } .full-text td { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); } .full-text-translation { padding : 4px; margin: 0 -2pt; } #BABFT_Copyright table{display: inline;} #BABFT_Copyright a{font-size: 70%;} #BAB_EmptyCorrectionDiv { margin-top: 6px; } span.CPCorrectionName { color: red; } span.MoreResultsHalf { width: 49%; text-align: center; padding:2px; } .BAB_normalOnlineGlossaries { font-weight : bold; border : 1px solid; border-color: expression(document.body.style.backgroundColor); } .BAB_overOnlineGlossaries { font-weight : bold; background: #FFFEF2; border : 1px solid; border-color: expression("#C6CED3"); cursor: hand; } .BAB_pushOnlineGlossaries { font-weight : bold; background: #FFFEF2; border : 1px solid; border-color: expression("#C6CED3"); cursor: hand; position : relative; /* set pushed depth */ top : 1px; left : 1px; } .BAB_grayOnlineGlossaries { font-weight : bold; font-color: #C5C5C5; border : 1px solid; border-color: expression(document.body.style.backgroundColor); } .BAB_TD, .BAB_CPCrossCellStyle { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); padding: 0; margin: 0; vertical-align: middle; } .BAB_CPBodyStyleLocal HR { color : #A0BDDF; height : 1px; } .DIV_AS_HR { margin-left: 10pt; margin-right: 10pt; margin-bottom: 2pt; font-size : 1px; background : #EAEAD6; line-height : 1px; clear : both; } .external HR{color : #EAEAD6} .BAB_CPTitleStyle { background-color : #FFFFBF; padding : 2pt; margin-top: 2pt; border-top-color: rgb(151,166,187); border-top-style: solid; border-top-width: 1px; clear : both; } .BAB_ImgInTitle { margin : 3px 0 0 4px; overflow : hidden; width : 16px; height : 16px; } .BAB_BtnsInTitle {text-align : right;} .BAB_CPBodyStyle, .BAB_CPBodyStyleCorp, .BAB_CPBodyStyleLocal { padding : 0; margin-left: 2pt; margin-right: 2pt; } .BAB_CPPOSStyle { color : blue; } .BAB_CPPhoneticsStyle { color : gray; font-family : "Lucida Sans Unicode"; font-weight : normal; margin : 0px 0 0 5px; } .BAB_IPAPhoneticsStyle{ font-family : "Lucida Sans Unicode"; } .BAB_CPCopyrightStyle { font-size: 8pt; } .BAB_CPTrialMessageStyle { color : gray; text-align : center; font-size: 8pt; } .BAB_CPDefinitionStyle { margin-left: 10pt; margin-right: 10pt; padding-bottom: 2pt; } .BAB_CPDefinitionInTableStyle {padding-left: 2pt;} .BAB_CPCrossTableStyle { border-collapse: collapse; margin : 0 10px 6px 10px; border: solid #EAEAD6 1px; } .BAB_CPCrossCellStyle { border: solid #EAEAD6 1px; } .BAB_CPTermStyle {font-weight : bold;} .BAB_CPConvertStyle {border-collapse: collapse;} .BAB_CPConvertCellStyle {padding: 2pt;} .BAB_CPConvertText {font-size: 8pt;} .BAB_ImageBtn { BEHAVIOR : url(#default#BabyBtn); } .BAB_MoreResultsBand { background: expression(document.body.style.backgroundColor); border-top:solid rgb(151,166,187) 2px; margin-top:2pt; margin-bottom: 2pt; padding: 2pt; clear : both; direction:ltr; } .BAB_MoreResultsBand td { font-size: 8pt; } .BAB_MoreResultsLink, .BAB_CorrectionsLink { font-weight: bold; font-size: 100%; } .BAB_normalTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; } .BAB_overTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; background-color : #FFFFBF; cursor: pointer; } .BAB_pushTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; background-color : #FFFFBF; cursor: pointer; } .BAB_textMenuEmpty { border : 1pt solid; border-color: expression(document.body.style.backgroundColor); cursor: default; padding: 1pt; padding-left: 2pt; padding-right: 2pt; height: expression(document.body.style.fontSize); } .BAB_textMenuNormal { border-left : 1pt solid #E7E7C7; border-right : 1pt solid #ADAD72; border-bottom : 1pt solid #ADAD72; border-top : 1pt solid #E7E7C7; background-color : #FBFBB6; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .BAB_textMenuOver { border-left : 1pt solid; border-right : 1pt solid; border-bottom : 1pt solid; border-top : 1pt solid; border-color: expression("#CCCCB0"); background-color : #FFFF9D; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .BAB_textMenuPush { border-right : 1pt solid; border-left : 1pt solid; border-bottom : 1pt solid; border-top : 1pt solid; border-color: expression("#777753"); background-color: #E8E8AB; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .result {padding : 2px 4px 0 4px;} .top-row td { height : 3px; overflow : hidden; } .title-td, .title-tdCorp { font-family : expression(document.body.style.fontFamily); font-size : expression(document.body.style.fontSize); white-space : nowrap; border-bottom : 1px solid #c6ced3; background : #fffef2; } .top-border { border-top : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; height : 4px; } .right-border { border-right : 1px solid #c6ced3; border-bottom : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; width : 4px; } .left-border { border-left : 1px solid #c6ced3; border-bottom : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; width : 4px; } .header { background-color : #FFFEF2; border : solid #C6CED3; border-width : 1px 0; height : 25px; overflow : hidden; margin : 0 2px; } .title { float : left; margin : 4px 0 0 4px; font-weight : bold; } .gloss-btn .BAB_ImageBtn { margin : 0 4px; width : 8px; height : 8px; } .buttons{ margin : -1px -1px 0; float : right; } .buttons img { cursor : pointer; margin : 0; } .term { clear : both; margin : 8px 10px 2px 10px; font-weight : bold; } .definition { margin : 0 10px 6px 10px; } .BAB_CPBodyStyleLocal .definition br {line-height : 50%;} .BAB_CPBodyStyleLocal .definition p {margin : 5px 0; padding : 0;} .BAB_CPBodyStyleLocal .definition dl {margin-top : 2px; margin-bottom : 4px;} .BAB_CPBodyStyleLocal .definition ul { margin : 2px 0 2px 18px; } .BAB_CPBodyStyleLocal .definition ol { margin : 2px 0 2px 32px; } .BAB_CPBodyStyleLocal .definition td { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); } .hr { height : 1px; overflow : hidden; background-color : #C6CED3; margin-bottom : 6px; } .copyright{margin-bottom : 8px; font-size:80%;} .copyright br {line-height : 0;} .prcTrial { margin-bottom : 4px; font-family : Arial; } .prcTrial-body { font-size: 11px; background-color : white; border : solid #C6CED3; border-width : 1px 0; height : 55px; overflow : hidden; padding : 2px 8px; color : #009; } .prcTrial-body img { height: 32px; width: 32px; margin-top : 2px; float : left; } .days-left { font-weight : bold; color : #009; text-align: left; white-space: nowrap; direction:ltr; } .left-corner{position : absolute; left : 3px;} .right-corner{position : absolute; right : -5px; padding-right: 8px; background:expression(document.body.style.backgroundColor);} .expired { font-weight : bold; color : #FF0024; white-space: nowrap; } .buy-link { display : block; color : #009; margin-top : 20px; float : left; text-decoration : none; direction:ltr; } .no-line{text-decoration : underline;} .remove-gloss { display : block; color : #009; float : right; margin-top : 20px; } .non-wrapping,.non-wrapping td { white-space : nowrap; } /* Sentence translation */ .full-text { padding: 0; border-left: 1px solid #c6ced3; border-right: 1px solid #c6ced3; border-bottom: 1px solid #c6ced3; overflow: hidden; width: 100%; margin: 0 -2pt; } .full-text td { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); } .full-text-translation { padding : 4px; margin: 0 -2pt; } #BABFT_Copyright table{display: inline;} #BABFT_Copyright a{font-size: 70%;} #BAB_EmptyCorrectionDiv { margin-top: 6px; } span.CPCorrectionName { color: red; } span.MoreResultsHalf { width: 49%; text-align: center; padding:2px; } .BAB_normalOnlineGlossaries { font-weight : bold; border : 1px solid; border-color: expression(document.body.style.backgroundColor); } .BAB_overOnlineGlossaries { font-weight : bold; background: #FFFEF2; border : 1px solid; border-color: expression("#C6CED3"); cursor: hand; } .BAB_pushOnlineGlossaries { font-weight : bold; background: #FFFEF2; border : 1px solid; border-color: expression("#C6CED3"); cursor: hand; position : relative; /* set pushed depth */ top : 1px; left : 1px; } .BAB_grayOnlineGlossaries { font-weight : bold; font-color: #C5C5C5; border : 1px solid; border-color: expression(document.body.style.backgroundColor); } .BAB_TD, .BAB_CPCrossCellStyle { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); padding: 0; margin: 0; vertical-align: middle; } .BAB_CPBodyStyleLocal HR { color : #A0BDDF; height : 1px; } .DIV_AS_HR { margin-left: 10pt; margin-right: 10pt; margin-bottom: 2pt; font-size : 1px; background : #EAEAD6; line-height : 1px; clear : both; } .external HR{color : #EAEAD6} .BAB_CPTitleStyle { background-color : #FFFFBF; padding : 2pt; margin-top: 2pt; border-top-color: rgb(151,166,187); border-top-style: solid; border-top-width: 1px; clear : both; } .BAB_ImgInTitle { margin : 3px 0 0 4px; overflow : hidden; width : 16px; height : 16px; } .BAB_BtnsInTitle {text-align : right;} .BAB_CPBodyStyle, .BAB_CPBodyStyleCorp, .BAB_CPBodyStyleLocal { padding : 0; margin-left: 2pt; margin-right: 2pt; } .BAB_CPPOSStyle { color : blue; } .BAB_CPPhoneticsStyle { color : gray; font-family : "Lucida Sans Unicode"; font-weight : normal; margin : 0px 0 0 5px; } .BAB_IPAPhoneticsStyle{ font-family : "Lucida Sans Unicode"; } .BAB_CPCopyrightStyle { font-size: 8pt; } .BAB_CPTrialMessageStyle { color : gray; text-align : center; font-size: 8pt; } .BAB_CPDefinitionStyle { margin-left: 10pt; margin-right: 10pt; padding-bottom: 2pt; } .BAB_CPDefinitionInTableStyle {padding-left: 2pt;} .BAB_CPCrossTableStyle { border-collapse: collapse; margin : 0 10px 6px 10px; border: solid #EAEAD6 1px; } .BAB_CPCrossCellStyle { border: solid #EAEAD6 1px; } .BAB_CPTermStyle {font-weight : bold;} .BAB_CPConvertStyle {border-collapse: collapse;} .BAB_CPConvertCellStyle {padding: 2pt;} .BAB_CPConvertText {font-size: 8pt;} .BAB_ImageBtn { BEHAVIOR : url(#default#BabyBtn); } .BAB_MoreResultsBand { background: expression(document.body.style.backgroundColor); border-top:solid rgb(151,166,187) 2px; margin-top:2pt; margin-bottom: 2pt; padding: 2pt; clear : both; direction:ltr; } .BAB_MoreResultsBand td { font-size: 8pt; } .BAB_MoreResultsLink, .BAB_CorrectionsLink { font-weight: bold; font-size: 100%; } .BAB_normalTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; } .BAB_overTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; background-color : #FFFFBF; cursor: pointer; } .BAB_pushTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; background-color : #FFFFBF; cursor: pointer; } .BAB_textMenuEmpty { border : 1pt solid; border-color: expression(document.body.style.backgroundColor); cursor: default; padding: 1pt; padding-left: 2pt; padding-right: 2pt; height: expression(document.body.style.fontSize); } .BAB_textMenuNormal { border-left : 1pt solid #E7E7C7; border-right : 1pt solid #ADAD72; border-bottom : 1pt solid #ADAD72; border-top : 1pt solid #E7E7C7; background-color : #FBFBB6; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .BAB_textMenuOver { border-left : 1pt solid; border-right : 1pt solid; border-bottom : 1pt solid; border-top : 1pt solid; border-color: expression("#CCCCB0"); background-color : #FFFF9D; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .BAB_textMenuPush { border-right : 1pt solid; border-left : 1pt solid; border-bottom : 1pt solid; border-top : 1pt solid; border-color: expression("#777753"); background-color: #E8E8AB; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .result {padding : 2px 4px 0 4px;} .top-row td { height : 3px; overflow : hidden; } .title-td, .title-tdCorp { font-family : expression(document.body.style.fontFamily); font-size : expression(document.body.style.fontSize); white-space : nowrap; border-bottom : 1px solid #c6ced3; background : #fffef2; } .top-border { border-top : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; height : 4px; } .right-border { border-right : 1px solid #c6ced3; border-bottom : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; width : 4px; } .left-border { border-left : 1px solid #c6ced3; border-bottom : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; width : 4px; } .header { background-color : #FFFEF2; border : solid #C6CED3; border-width : 1px 0; height : 25px; overflow : hidden; margin : 0 2px; } .title { float : left; margin : 4px 0 0 4px; font-weight : bold; } .gloss-btn .BAB_ImageBtn { margin : 0 4px; width : 8px; height : 8px; } .buttons{ margin : -1px -1px 0; float : right; } .buttons img { cursor : pointer; margin : 0; } .term { clear : both; margin : 8px 10px 2px 10px; font-weight : bold; } .definition { margin : 0 10px 6px 10px; } .BAB_CPBodyStyleLocal .definition br {line-height : 50%;} .BAB_CPBodyStyleLocal .definition p {margin : 5px 0; padding : 0;} .BAB_CPBodyStyleLocal .definition dl {margin-top : 2px; margin-bottom : 4px;} .BAB_CPBodyStyleLocal .definition ul { margin : 2px 0 2px 18px; } .BAB_CPBodyStyleLocal .definition ol { margin : 2px 0 2px 32px; } .BAB_CPBodyStyleLocal .definition td { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); } .hr { height : 1px; overflow : hidden; background-color : #C6CED3; margin-bottom : 6px; } .copyright{margin-bottom : 8px; font-size:80%;} .copyright br {line-height : 0;} .prcTrial { margin-bottom : 4px; font-family : Arial; } .prcTrial-body { font-size: 11px; background-color : white; border : solid #C6CED3; border-width : 1px 0; height : 55px; overflow : hidden; padding : 2px 8px; color : #009; } .prcTrial-body img { height: 32px; width: 32px; margin-top : 2px; float : left; } .days-left { font-weight : bold; color : #009; text-align: left; white-space: nowrap; direction:ltr; } .left-corner{position : absolute; left : 3px;} .right-corner{position : absolute; right : -5px; padding-right: 8px; background:expression(document.body.style.backgroundColor);} .expired { font-weight : bold; color : #FF0024; white-space: nowrap; } .buy-link { display : block; color : #009; margin-top : 20px; float : left; text-decoration : none; direction:ltr; } .no-line{text-decoration : underline;} .remove-gloss { display : block; color : #009; float : right; margin-top : 20px; } .non-wrapping,.non-wrapping td { white-space : nowrap; } /* Sentence translation */ .full-text { padding: 0; border-left: 1px solid #c6ced3; border-right: 1px solid #c6ced3; border-bottom: 1px solid #c6ced3; overflow: hidden; width: 100%; margin: 0 -2pt; } .full-text td { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); } .full-text-translation { padding : 4px; margin: 0 -2pt; } #BABFT_Copyright table{display: inline;} #BABFT_Copyright a{font-size: 70%;} #BAB_EmptyCorrectionDiv { margin-top: 6px; } span.CPCorrectionName { color: red; } span.MoreResultsHalf { width: 49%; text-align: center; padding:2px; } .BAB_normalOnlineGlossaries { font-weight : bold; border : 1px solid; border-color: expression(document.body.style.backgroundColor); } .BAB_overOnlineGlossaries { font-weight : bold; background: #FFFEF2; border : 1px solid; border-color: expression("#C6CED3"); cursor: hand; } .BAB_pushOnlineGlossaries { font-weight : bold; background: #FFFEF2; border : 1px solid; border-color: expression("#C6CED3"); cursor: hand; position : relative; /* set pushed depth */ top : 1px; left : 1px; } .BAB_grayOnlineGlossaries { font-weight : bold; font-color: #C5C5C5; border : 1px solid; border-color: expression(document.body.style.backgroundColor); } .BAB_TD, .BAB_CPCrossCellStyle { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); padding: 0; margin: 0; vertical-align: middle; } .BAB_CPBodyStyleLocal HR { color : #A0BDDF; height : 1px; } .DIV_AS_HR { margin-left: 10pt; margin-right: 10pt; margin-bottom: 2pt; font-size : 1px; background : #EAEAD6; line-height : 1px; clear : both; } .external HR{color : #EAEAD6} .BAB_CPTitleStyle { background-color : #FFFFBF; padding : 2pt; margin-top: 2pt; border-top-color: rgb(151,166,187); border-top-style: solid; border-top-width: 1px; clear : both; } .BAB_ImgInTitle { margin : 3px 0 0 4px; overflow : hidden; width : 16px; height : 16px; } .BAB_BtnsInTitle {text-align : right;} .BAB_CPBodyStyle, .BAB_CPBodyStyleCorp, .BAB_CPBodyStyleLocal { padding : 0; margin-left: 2pt; margin-right: 2pt; } .BAB_CPPOSStyle { color : blue; } .BAB_CPPhoneticsStyle { color : gray; font-family : "Lucida Sans Unicode"; font-weight : normal; margin : 0px 0 0 5px; } .BAB_IPAPhoneticsStyle{ font-family : "Lucida Sans Unicode"; } .BAB_CPCopyrightStyle { font-size: 8pt; } .BAB_CPTrialMessageStyle { color : gray; text-align : center; font-size: 8pt; } .BAB_CPDefinitionStyle { margin-left: 10pt; margin-right: 10pt; padding-bottom: 2pt; } .BAB_CPDefinitionInTableStyle {padding-left: 2pt;} .BAB_CPCrossTableStyle { border-collapse: collapse; margin : 0 10px 6px 10px; border: solid #EAEAD6 1px; } .BAB_CPCrossCellStyle { border: solid #EAEAD6 1px; } .BAB_CPTermStyle {font-weight : bold;} .BAB_CPConvertStyle {border-collapse: collapse;} .BAB_CPConvertCellStyle {padding: 2pt;} .BAB_CPConvertText {font-size: 8pt;} .BAB_ImageBtn { BEHAVIOR : url(#default#BabyBtn); } .BAB_MoreResultsBand { background: expression(document.body.style.backgroundColor); border-top:solid rgb(151,166,187) 2px; margin-top:2pt; margin-bottom: 2pt; padding: 2pt; clear : both; direction:ltr; } .BAB_MoreResultsBand td { font-size: 8pt; } .BAB_MoreResultsLink, .BAB_CorrectionsLink { font-weight: bold; font-size: 100%; } .BAB_normalTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; } .BAB_overTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; background-color : #FFFFBF; cursor: pointer; } .BAB_pushTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; background-color : #FFFFBF; cursor: pointer; } .BAB_textMenuEmpty { border : 1pt solid; border-color: expression(document.body.style.backgroundColor); cursor: default; padding: 1pt; padding-left: 2pt; padding-right: 2pt; height: expression(document.body.style.fontSize); } .BAB_textMenuNormal { border-left : 1pt solid #E7E7C7; border-right : 1pt solid #ADAD72; border-bottom : 1pt solid #ADAD72; border-top : 1pt solid #E7E7C7; background-color : #FBFBB6; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .BAB_textMenuOver { border-left : 1pt solid; border-right : 1pt solid; border-bottom : 1pt solid; border-top : 1pt solid; border-color: expression("#CCCCB0"); background-color : #FFFF9D; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .BAB_textMenuPush { border-right : 1pt solid; border-left : 1pt solid; border-bottom : 1pt solid; border-top : 1pt solid; border-color: expression("#777753"); background-color: #E8E8AB; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .result {padding : 2px 4px 0 4px;} .top-row td { height : 3px; overflow : hidden; } .title-td, .title-tdCorp { font-family : expression(document.body.style.fontFamily); font-size : expression(document.body.style.fontSize); white-space : nowrap; border-bottom : 1px solid #c6ced3; background : #fffef2; } .top-border { border-top : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; height : 4px; } .right-border { border-right : 1px solid #c6ced3; border-bottom : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; width : 4px; } .left-border { border-left : 1px solid #c6ced3; border-bottom : 1px solid #c6ced3; background : #fffef2; overflow : hidden; font-size : 1px; width : 4px; } .header { background-color : #FFFEF2; border : solid #C6CED3; border-width : 1px 0; height : 25px; overflow : hidden; margin : 0 2px; } .title { float : left; margin : 4px 0 0 4px; font-weight : bold; } .gloss-btn .BAB_ImageBtn { margin : 0 4px; width : 8px; height : 8px; } .buttons{ margin : -1px -1px 0; float : right; } .buttons img { cursor : pointer; margin : 0; } .term { clear : both; margin : 8px 10px 2px 10px; font-weight : bold; } .definition { margin : 0 10px 6px 10px; } .BAB_CPBodyStyleLocal .definition br {line-height : 50%;} .BAB_CPBodyStyleLocal .definition p {margin : 5px 0; padding : 0;} .BAB_CPBodyStyleLocal .definition dl {margin-top : 2px; margin-bottom : 4px;} .BAB_CPBodyStyleLocal .definition ul { margin : 2px 0 2px 18px; } .BAB_CPBodyStyleLocal .definition ol { margin : 2px 0 2px 32px; } .BAB_CPBodyStyleLocal .definition td { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); } .hr { height : 1px; overflow : hidden; background-color : #C6CED3; margin-bottom : 6px; } .copyright{margin-bottom : 8px; font-size:80%;} .copyright br {line-height : 0;} .prcTrial { margin-bottom : 4px; font-family : Arial; } .prcTrial-body { font-size: 11px; background-color : white; border : solid #C6CED3; border-width : 1px 0; height : 55px; overflow : hidden; padding : 2px 8px; color : #009; } .prcTrial-body img { height: 32px; width: 32px; margin-top : 2px; float : left; } .days-left { font-weight : bold; color : #009; text-align: left; white-space: nowrap; direction:ltr; } .left-corner{position : absolute; left : 3px;} .right-corner{position : absolute; right : -5px; padding-right: 8px; background:expression(document.body.style.backgroundColor);} .expired { font-weight : bold; color : #FF0024; white-space: nowrap; } .buy-link { display : block; color : #009; margin-top : 20px; float : left; text-decoration : none; direction:ltr; } .no-line{text-decoration : underline;} .remove-gloss { display : block; color : #009; float : right; margin-top : 20px; } .non-wrapping,.non-wrapping td { white-space : nowrap; } /* Sentence translation */ .full-text { padding: 0; border-left: 1px solid #c6ced3; border-right: 1px solid #c6ced3; border-bottom: 1px solid #c6ced3; overflow: hidden; width: 100%; margin: 0 -2pt; } .full-text td { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); } .full-text-translation { padding : 4px; margin: 0 -2pt; } #BABFT_Copyright table{display: inline;} #BABFT_Copyright a{font-size: 70%;} #BAB_EmptyCorrectionDiv { margin-top: 6px; } span.CPCorrectionName { color: red; } span.MoreResultsHalf { width: 49%; text-align: center; padding:2px; } .BAB_normalOnlineGlossaries { font-weight : bold; border : 1px solid; border-color: expression(document.body.style.backgroundColor); } .BAB_overOnlineGlossaries { font-weight : bold; background: #FFFEF2; border : 1px solid; border-color: expression("#C6CED3"); cursor: hand; } .BAB_pushOnlineGlossaries { font-weight : bold; background: #FFFEF2; border : 1px solid; border-color: expression("#C6CED3"); cursor: hand; position : relative; /* set pushed depth */ top : 1px; left : 1px; } .BAB_grayOnlineGlossaries { font-weight : bold; font-color: #C5C5C5; border : 1px solid; border-color: expression(document.body.style.backgroundColor); } .BAB_TD, .BAB_CPCrossCellStyle { font-size : expression(document.body.style.fontSize); font-family : expression(document.body.style.fontFamily); padding: 0; margin: 0; vertical-align: middle; } .BAB_CPBodyStyleLocal HR { color : #A0BDDF; height : 1px; } .DIV_AS_HR { margin-left: 10pt; margin-right: 10pt; margin-bottom: 2pt; font-size : 1px; background : #EAEAD6; line-height : 1px; clear : both; } .external HR{color : #EAEAD6} .BAB_CPTitleStyle { background-color : #FFFFBF; padding : 2pt; margin-top: 2pt; border-top-color: rgb(151,166,187); border-top-style: solid; border-top-width: 1px; clear : both; } .BAB_ImgInTitle { margin : 3px 0 0 4px; overflow : hidden; width : 16px; height : 16px; } .BAB_BtnsInTitle {text-align : right;} .BAB_CPBodyStyle, .BAB_CPBodyStyleCorp, .BAB_CPBodyStyleLocal { padding : 0; margin-left: 2pt; margin-right: 2pt; } .BAB_CPPOSStyle { color : blue; } .BAB_CPPhoneticsStyle { color : gray; font-family : "Lucida Sans Unicode"; font-weight : normal; margin : 0px 0 0 5px; } .BAB_IPAPhoneticsStyle{ font-family : "Lucida Sans Unicode"; } .BAB_CPCopyrightStyle { font-size: 8pt; } .BAB_CPTrialMessageStyle { color : gray; text-align : center; font-size: 8pt; } .BAB_CPDefinitionStyle { margin-left: 10pt; margin-right: 10pt; padding-bottom: 2pt; } .BAB_CPDefinitionInTableStyle {padding-left: 2pt;} .BAB_CPCrossTableStyle { border-collapse: collapse; margin : 0 10px 6px 10px; border: solid #EAEAD6 1px; } .BAB_CPCrossCellStyle { border: solid #EAEAD6 1px; } .BAB_CPTermStyle {font-weight : bold;} .BAB_CPConvertStyle {border-collapse: collapse;} .BAB_CPConvertCellStyle {padding: 2pt;} .BAB_CPConvertText {font-size: 8pt;} .BAB_ImageBtn { BEHAVIOR : url(#default#BabyBtn); } .BAB_MoreResultsBand { background: expression(document.body.style.backgroundColor); border-top:solid rgb(151,166,187) 2px; margin-top:2pt; margin-bottom: 2pt; padding: 2pt; clear : both; direction:ltr; } .BAB_MoreResultsBand td { font-size: 8pt; } .BAB_MoreResultsLink, .BAB_CorrectionsLink { font-weight: bold; font-size: 100%; } .BAB_normalTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; } .BAB_overTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; background-color : #FFFFBF; cursor: pointer; } .BAB_pushTitle { margin : 3px 0 0 4px; font-weight : bold; font-size : 80%; background-color : #FFFFBF; cursor: pointer; } .BAB_textMenuEmpty { border : 1pt solid; border-color: expression(document.body.style.backgroundColor); cursor: default; padding: 1pt; padding-left: 2pt; padding-right: 2pt; height: expression(document.body.style.fontSize); } .BAB_textMenuNormal { border-left : 1pt solid #E7E7C7; border-right : 1pt solid #ADAD72; border-bottom : 1pt solid #ADAD72; border-top : 1pt solid #E7E7C7; background-color : #FBFBB6; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .BAB_textMenuOver { border-left : 1pt solid; border-right : 1pt solid; border-bottom : 1pt solid; border-top : 1pt solid; border-color: expression("#CCCCB0"); background-color : #FFFF9D; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); } .BAB_textMenuPush { border-right : 1pt solid; border-left : 1pt solid; border-bottom : 1pt solid; border-top : 1pt solid; border-color: expression("#777753"); background-color: #E8E8AB; padding: 1pt; padding-left: 2pt; padding-right: 2pt; cursor: default; height: expression(document.body.style.fontSize); }

Could you please explain how to reproduce the exact situation using simple code, similar to the code in #4 above, with step by step instructions?

ObjectDB Support
#9

My simplified code for doing the backups is the following:

EntityManager em = database.createEntityManager();
try {
    TypedQuery<Thread> backupQuery = em.createQuery("objectdb backup", Thread.class);
    backupQuery.setParameter("target", "/someNotExistingPath/withoutCreateAccess");
    backupQuery.setParameter("name", "20231012");
    backupQuery.setParameter("start", false);
    Thread backupThread = backupQuery.getSingleResult();
    backupThread.setUncaughtExceptionHandler((t, e) -> {
        error("Failed backup of " + database.getDbName(), e);
    });
    backupThread.start();
    
    // Wait until the backup is completed.
    try {
        backupThread.join();
    } catch (InterruptedException e) {
        LOG.error(e);
    }
} finally {
    if (em.isOpen()) {
        em.close();
    }    
}

 I was debugging the process and saw the first catch block in TOL caught the UserException, but there was no additional exception, so the inner catch block was skipped over. The UserException was raised after some File.mkdirs() method failed to create the missing directories, so the important part is to set as "target" a not existing Path, which should be created via the Backup, but it fails to create it due to missing file permissions.

#10

Please try build 2.8.9_04.

ObjectDB Support
#11

It works nicely in the latest build.

Thx!

Reply