Open alcarraz opened 11 months ago
If agreed, I can implement the PR.
We can approach this in two ways:
Initiate the file with a .tmp
extension and subsequently rename it. However, potential challenges could arise with Windows' move or when deploying to a FUSE file system.
Implement an internal Semaphore, given this is a Q2 method. While this seems more streamlined initially, it could pose issues if multiple Q2s utilize the same deploy. This scenario, albeit unusual, is still possible.
Both methods come with their respective advantages and limitations.
In
Q2.deployElement
we create the file directly in thedeploy
directory. I believe this may be causing what's reported in this stack overflow question.Maybe we should do the same that is advised, of writing the file in a temporary file, maybe with a
.tmp
extension, and then move it to the final deploy name?https://github.com/jpos/jPOS/blob/f0471696043559b51e3b075d22a6944b932df9f8/jpos/src/main/java/org/jpos/q2/Q2.java#L813-L832