[CDV-1243] dso-java.bat cannot be used multiple times concurrently because boot-jar-path.bat does net generate unquie temporary file names. Created: 10/Apr/09 Updated: 12/Feb/13 Resolved: 14/Apr/09 Status: Project: Component/s: Affects Version/s: Fix Version/s: Closed Community Development (Terracotta Server) None 3.0.0 Type: Reporter: Resolution: Labels: Remaining Estimate: Time Spent: Original Estimate: Bug Troy Anderson Fixed None Not Specified Attachments: boot-jar-path.bat 3 Feature failure (but usable), workaround available trunk trunk 12518, 3.0 12519 Severity: Fix In Branch: Fixed In Revision: Bug Found In Detail: 3.1.0 Priority: Assignee: Votes: 2 Major Kalai Kannaiyan 0 Not Specified Not Specified Terracotta 3.0.0-stable1 Description When starting a multiple TC clients simultaneously with dso-java.bat, "boot-jr-path.bat" is called which utilizes a temporary file name "var~". Because this file gets locked while in use, concurrently running scripts will error out. I have attached a modified boot-jar-path.bat file that calls setlocal and always sets the temp filename to a %RANDOM% value. There is still a chance the random number generator could return the same value for concurrently running scripts... so the ultimate fix should use a more robust method of generating a unique filename. Comments Comment by Troy Anderson [ 14/Apr/09 ] Please ignore the attached batch file. It is not a solution. It does not work. Comment by Hung Huynh [ 14/Apr/09 ] use both %RANDOM% and %TIME% to ensure uniqueness of temp file :tc_set_dso_boot_jar__1_0 if not defined TMPFILE set TMPFILE=%TEMP%\var~ + call :GETTEMPNAME %TC_JAVACMD% %JAVA_OPTS% -cp %TC_JAR% com.tc.object.tools.BootJarSignature >%TMPFILE% for /F %%i in (%TMPFILE%) do @set DSO_BOOT_JAR_NAME=%%i del %TMPFILE% @@ -72,6 +72,10 @@ if %ERRORLEVEL% NEQ 0 goto error goto return +:GETTEMPNAME +set TMPFILE=%TMP%\boot-jar-path-%RANDOM%-%TIME:~6,5%.tmp +if exist "%TMPFILE%" GOTO :GETTEMPNAME + :error exit /b %ERRORLEVEL% Comment by Kalai Kannaiyan [ 12/Aug/09 ] Verified with 3.1.0-nighlty rev13396, executing the pojo samples run.bat multiple times really quick, it is working fine. Generated at Sat Mar 05 23:48:21 PST 2016 using JIRA 6.2.4#6261sha1:4d2e6f6f26064845673c8e7ffe9b6b84b45a6e79.