java - Microsoft Azure and Glassfish -
i having problem azure database , glassfish. azure database closing connection glassfish pool after 2 minutes. found the solution here having hard time implementing it.
where put code ?
<startup> <task commandline="startup.cmd" executioncontext="elevated" tasktype="simple"> </task> </startup>
where put file code ?
if exist startup.txt goto skip time /t >> startup.txt rem workaround jdbc sql azure reg add hkey_local_machine\system\currentcontrolset\services\tcpip\parameters /v keepalivetime /t reg_dword /d 30000 >> startup.txt reg add hkey_local_machine\system\currentcontrolset\services\tcpip\parameters /v keepaliveinterval /t reg_dword /d 1000 >> startup.txt reg add hkey_local_machine\system\currentcontrolset\services\tcpip\parameters /v tcpmaxdataretransmission /t reg_dword /d 10 >> startup.txt shutdown /r /t 1 :skip
if deploy azure cloud service on azure, can use startup task execute cmd file , configure setting in .csdfg file. can follow steps:
- if use eclipse ide develop java program, can install plugin "azure toolkit eclipse" eclipse marketplace.
about azure toolkit eclipse, refer link https://msdn.microsoft.com/en-us/library/hh694271.aspx.
after installed plugin on eclipse ide, can create azure deployment project, seen screensnap below.
create file named "startup.cmd" , fill powershell code it.
configure startup task code "servicedefinition.csdef" in cloudservice project.
you find "servicedefinition.csdef" in new project.
in file, can configure startup task.
about startup task details, refer https://msdn.microsoft.com/en-us/library/hh180155.aspx.
the startup task concept of cloud service on azure. cloud service has 2 role concepts: web role, worker role. startup task necessary things before roles start runing, such configure runtime environment, modify registry keys.
about azure cloud service, refer https://msdn.microsoft.com/en-us/library/hh124108.aspx.
for java developer, refer https://msdn.microsoft.com/en-us/library/hh690943.aspx
if use azure vm, suggest can modify registry keys manually. recommend can refer post:
Comments
Post a Comment