Index: vhUnitTest/APPS/HR/ProTime/Facade.cls.xml
===================================================================
diff -u -r1742 -r2192
--- vhUnitTest/APPS/HR/ProTime/Facade.cls.xml (.../Facade.cls.xml) (revision 1742)
+++ vhUnitTest/APPS/HR/ProTime/Facade.cls.xml (.../Facade.cls.xml) (revision 2192)
@@ -26,7 +26,6 @@
%Status
0
-
-wat met locking ??? wat als iemand bezig is met het bestand te wijzigen ???
%String
+1
-
-
-
-
%FileCharacterStream
+1
@@ -54,20 +47,27 @@
Leest een lijn uit.
-Resultaat -1 = einde van bestand.
-
-(RV-JCL) zou AtEnd in aparte waarde steken .. wat als de tekst juist -1 is ;-)
-wat met rewind ??? of iedere keer file reader opnieuw openen..
+Resultaat -1 = einde van bestand.
%String
+
+%Boolean
+
+
+
%Boolean
1
1
%Status
-
Index: vhUnitTest/APPS/CRM/TestKlantBestand.cls.xml
===================================================================
diff -u -r1174 -r2192
--- vhUnitTest/APPS/CRM/TestKlantBestand.cls.xml (.../TestKlantBestand.cls.xml) (revision 1174)
+++ vhUnitTest/APPS/CRM/TestKlantBestand.cls.xml (.../TestKlantBestand.cls.xml) (revision 2192)
@@ -3,7 +3,7 @@
JBL + 2011-05-19
- Do ##class(vhUnitTest.Manager).RunTest("/Display=all","APPS.CRM.TestKlantBestand")
+Do ##class(vhUnitTest.Manager).RunTest("/Display=all","APPS.CRM.TestKlantBestand")
1
vhUnitTest.TestCase
0
Index: TECH/File/FileWriter.cls.xml
===================================================================
diff -u -r2184 -r2192
--- TECH/File/FileWriter.cls.xml (.../FileWriter.cls.xml) (revision 2184)
+++ TECH/File/FileWriter.cls.xml (.../FileWriter.cls.xml) (revision 2192)
@@ -15,14 +15,12 @@
1
-
+
TECH.Lock
1
-
-Lock vervangen door LockTool of LockHelper
%Boolean
1
@@ -40,9 +38,9 @@
Set ..WriteImmediate = WriteImmediate
/// Nagaan of reeds naar bestand wordt geschreven door ander process
- Set ..Lock = ##class(TECH.Lock).%New(..GeefLockKey())
- If ('..Lock.HeeftLock()) {
- Do ..Lock.Lock(##class(TECH.enu.LockType).Exclusive())
+ Set ..LockHelper = ##class(TECH.Lock).%New(..GeefLockKey())
+ If ('..LockHelper.IsGelocked()) {
+ Do ..LockHelper.Lock(##class(TECH.enu.LockType).Exclusive())
}Else{
Set Exception = ##class(TECH.Exceptions.FileException).%New("Er wordt reeds naar de file '"_..Bestand_"' geschreven.",1)
Do ##class(TECH.ExceptionHandler).Throw(Exception)
@@ -60,7 +58,7 @@
Set ..FileCharacterStream.Filename = ..Bestand
}Else{
Set TempDir = ##class(TECH.Config.ConfigMgr).Instance().GetString("vhDev.TempFilePath")
- Set TempFile = $job_"_"_##class(TECH.DateTime).CurrentTime()_"_"_$random(99999999) // (RV-JCL) misschien vaste extensie gebruiken..
+ Set TempFile = $job_"_"_##class(TECH.DateTime).CurrentTime()_"_"_$random(99999999)_".tmp"
Set TempBestand = ##class(TECH.Files).AppendFile(TempDir,TempFile)
Set ..FileCharacterStream.Filename = TempBestand
}
@@ -87,16 +85,15 @@
Do ##class(TECH.ExceptionHandler).Throw(Exception)
}
}Else{
- Set Exception = ##class(TECH.Exceptions.FileException).%New("Bestand kon niet worden verplaatst. '"_Filename_"' naar '"_..Bestand_"'.",0)
+ Set DeleteGelukt = ##class(TECH.File).Delete(Filename)
+ Set Exception = ##class(TECH.Exceptions.FileException).%New("Bestand kon niet worden verplaatst. '"_Filename_"' naar '"_..Bestand_"'. "_Filename_" is verwijderd ? "_DeleteGelukt_".",0)
Do ##class(TECH.ExceptionHandler).Throw(Exception)
-
- /// (RV-JCL) hier toch delete herhalen van het temp bestand
}
}
Set ..FileCharacterStream = ""
Catch
Set $ZTRAP = ""
- Do ..Lock.UnLock(##class(TECH.enu.LockType).Exclusive())
+ Do ..LockHelper.UnLock(##class(TECH.enu.LockType).Exclusive())
]]>
@@ -129,7 +126,7 @@
1
%String
-
Index: TECH/Lock.cls.xml
===================================================================
diff -u -r2184 -r2192
--- TECH/Lock.cls.xml (.../Lock.cls.xml) (revision 2184)
+++ TECH/Lock.cls.xml (.../Lock.cls.xml) (revision 2192)
@@ -27,31 +27,14 @@
TimeOut:%Integer=10,LockType:TECH.enu.LockType="X"
+
+%Boolean
+
+
+
%Boolean