Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Super Contributor.. AldoH Super Contributor..
Super Contributor..
182 views

How can I replace an Event Processor without restarting the Records Manager service on the server?

Jump to solution

Hi,

With Records Manager we use some Event Processors. Recently I was asked to change part of the code of one of those Events and now I need to pass it to the production server. The problem I have is that the current .dll file is blocked by the Records Manager service on the server. I know that if I stop the Records Manager service, the dll file will be released and I will be able to replace it, but stopping the service implies leaving all users without access for some time and that is a scenario that I want to avoid. Records Manager is constantly used 24 hours a day, 7 days a week, so stopping the service is not an option I want to opt for.

Is there any way to release that dll file so I can replace it that does not involve restarting the Records Manager service on the server?

Thank you in advance for your help.

0 Likes
1 Solution

Accepted Solutions
Honored Contributor.. davros29 Honored Contributor..
Honored Contributor..

Re: How can I replace an Event Processor without restarting the Records Manager service on the serve

Jump to solution

Following (because I want to see if there's a better way but I'm not too hopeful).

I don't think there's a way around stopping the trimworkgroup service while you update this. I use a script to minimise the downtime but unless you configure your events to run on a server that no end users connect to, then a short outage is unavoidable. Also remember to have enterprise studio closed when updating! That tripped me up the other day - couldn't work out what was keeping a lock on the DLL after I'd shut down the service!

If it helps, here's the script I'm using at the moment.

# Servers to update
$wgs = 'TRIMUAT01','TRIMUAT02','TRIMUAT03','TRIMUAT04'

# Path to new version of DLL
$newDLL = "D:\INSTALL\TRIM\CustomEventProcessor\20191126\TRIM.CustomEventProcessor.dll"

# Deploy new DLL to each server
$wgs | % { 

Write-Host "Updating $_..." -ForegroundColor Yellow -BackgroundColor Black
# Stop the TRIM services
Invoke-Command -ComputerName $_ -ScriptBlock { Get-Service -Name TRIMWorkgroup | Stop-Service -Confirm:$false -Verbose } 
Invoke-Command -ComputerName $_ -ScriptBlock { Get-Process -Name TRIMEvent -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue -Verbose } 

# Copy the new DLL
Copy-Item -Path $newDLL -Destination "\\$_\C$\Program Files\Micro Focus\Content Manager\$(Split-Path $newDLL -Leaf)" -Force -Verbose

# Start the services
Invoke-Command -ComputerName $_ -ScriptBlock { Get-Service -Name TRIMWorkgroup | Start-Service -Verbose } 
Write-Host "`n"

}

 

View solution in original post

4 Replies
Honored Contributor.. davros29 Honored Contributor..
Honored Contributor..

Re: How can I replace an Event Processor without restarting the Records Manager service on the serve

Jump to solution

Following (because I want to see if there's a better way but I'm not too hopeful).

I don't think there's a way around stopping the trimworkgroup service while you update this. I use a script to minimise the downtime but unless you configure your events to run on a server that no end users connect to, then a short outage is unavoidable. Also remember to have enterprise studio closed when updating! That tripped me up the other day - couldn't work out what was keeping a lock on the DLL after I'd shut down the service!

If it helps, here's the script I'm using at the moment.

# Servers to update
$wgs = 'TRIMUAT01','TRIMUAT02','TRIMUAT03','TRIMUAT04'

# Path to new version of DLL
$newDLL = "D:\INSTALL\TRIM\CustomEventProcessor\20191126\TRIM.CustomEventProcessor.dll"

# Deploy new DLL to each server
$wgs | % { 

Write-Host "Updating $_..." -ForegroundColor Yellow -BackgroundColor Black
# Stop the TRIM services
Invoke-Command -ComputerName $_ -ScriptBlock { Get-Service -Name TRIMWorkgroup | Stop-Service -Confirm:$false -Verbose } 
Invoke-Command -ComputerName $_ -ScriptBlock { Get-Process -Name TRIMEvent -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue -Verbose } 

# Copy the new DLL
Copy-Item -Path $newDLL -Destination "\\$_\C$\Program Files\Micro Focus\Content Manager\$(Split-Path $newDLL -Leaf)" -Force -Verbose

# Start the services
Invoke-Command -ComputerName $_ -ScriptBlock { Get-Service -Name TRIMWorkgroup | Start-Service -Verbose } 
Write-Host "`n"

}

 

View solution in original post

Quinton Bernhardt Super Contributor.
Super Contributor.

Re: How can I replace an Event Processor without restarting the Records Manager service on the serve

Jump to solution

The problem is that the WGS locks your Dll containing your add-in class so...

A possible solution would be to have 2 (or more) .dlls.  The first containing your entry point and will be permanently loaded.  The second one containing your system functions is dynamically loaded and unloaded for each call to ProcessEvent(). 

This way you can replace the second one when it is not being used.  This is not safe though: if you're replacing it at the same time it tries to get loaded you'll be in a spot.  You'll have to build the loading code to anticipate this issue and perform an appropriate retry.  This is just a thought - have now done it myself.

 

clipboard_image_1.png

 

 

Regards,
Quinton Bernhardt
Meniko Records Management Services
Super Contributor.. AldoH Super Contributor..
Super Contributor..

Re: How can I replace an Event Processor without restarting the Records Manager service on the serve

Jump to solution

Hi Davros

Thanks for your help. I find the script you share to me very useful. I will implement it to have a minor impact on the service restart. Thank you very much.

Super Contributor.. AldoH Super Contributor..
Super Contributor..

Re: How can I replace an Event Processor without restarting the Records Manager service on the serve

Jump to solution

Hi Quinton,

It is a great idea to implement the function libraries in this way. I will make the changes to the codes I have so that with future changes I do not need to restart the Records Manager service.

Thank you

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.