cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
%3CLINGO-SUB%20id%3D%22lingo-sub-339784%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3EC%C3%B3mo%20mostrar%20un%20mensaje%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339784%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EHola%2C%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3EActualmente%20estoy%20creando%20un%20archivo%20JMP%20que%20act%C3%BAa%20como%20base%20de%20datos.%20Por%20lo%20tanto%2C%20me%20gustar%C3%ADa%20mostrar%20un%20mensaje%20%22Archivo%20en%20uso%22%20y%20mantener%20el%20archivo%20bloqueado%20para%20editarlo%20cuando%20alguien%20ya%20abri%C3%B3%20la%20base%20de%20datos%20y%20est%C3%A1%20realizando%20cambios%20en%20el%20archivo.%20Por%20ejemplo%2C%20el%20mismo%20mensaje%20que%20recibe%20cuando%20abre%20un%20archivo%20de%20Excel%20en%20una%20ubicaci%C3%B3n%20de%20servidor%20que%20ya%20est%C3%A1%20siendo%20utilizada%20por%20otra%20persona%3A%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22file%20in%20use%20message.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22file%20in%20use%20message.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22file%20in%20use%20message.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22file%20in%20use%20message.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F28754i41DD73882C69D926%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22file%20in%20use%20message.png%22%20alt%3D%22file%20in%20use%20message.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3ECreo%20que%20ya%20encontr%C3%A9%20parte%20de%20la%20respuesta%20en%20la%20siguiente%20publicaci%C3%B3n%20de%20la%20comunidad%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FMulti-User-Access%2Fm-p%2F109626%23U109626%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-forum-thread%20lia-fa-icon%20lia-fa-forum%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3EAcceso%20multiusuario%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3ESi%20estoy%20en%20lo%20cierto%2C%20a%C3%BAn%20necesitar%C3%ADa%20descubrir%20c%C3%B3mo%20bloquear%20la%20tabla%20si%20otro%20usuario%20la%20abre.%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3E%C2%BFAlguien%20podr%C3%ADa%20ayudarme%20a%20crear%20un%20script%20de%20este%20tipo%3F%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3EGracias%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-339784%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3EAcceso%20a%20los%20datos%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-341069%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20un%20mensaje%20de%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-341069%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EProbablemente%20funcionar%C3%A1%20en%20JMP%2014.%20Inform%C3%A9%20el%20problema%20JMP%2015%2F16%20que%20estaba%20viendo.%3C%2FP%3E%3CP%3ESi%20debe%20hacer%20que%20funcione%20en%2015%2C%20puede%20hacer%20algo%20como%20esta%20funci%C3%B3n%20que%20us%C3%A9%20en%20el%20complemento%20FileSnapper.%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3E%20FileSnapper%3AisFileOpenElsewhere%20%3D%20Function(%20%7Bfilepath%7D%2C%20%7Bdt%2C%20savelog%7D%2C%0A%20%20If(%20endswith(filepath%2C%22.jmp%22)%20%26amp%3B%20File%20Exists(%20filepath%20)%2C%0A%20%20%20dt%20%3D%20Open(%20filepath%2C%20private%20)%3B%20%20%0A%20%20%20savelog%20%3D%20Log%20Capture(%20dt%20%26lt%3B%26lt%3B%20save%20)%3B%0A%20%20%20close(dt%2C%22nosave%22)%3B%0A%20%20%20Length(%20savelog%20)%20!%3D%200%3B%20%2F%2F%20error%20message%20means%20another%20JMP%20has%20dt%20open%0A%20%20%2C%20%2F%2F%20else%0A%20%20%200%20%2F%2F%20not%20open%20if%20not%20exists%20%0A%20%20)%0A%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EFunciona%20intentando%20guardar%20el%20archivo%20tan%20pronto%20como%20se%20abre%20y%20detectando%20el%20mensaje%20de%20registro.%20Si%20no%20hay%20ning%C3%BAn%20mensaje%20de%20registro%2C%20el%20guardado%20funcion%C3%B3.%20Querr%C3%ADa%20reorganizar%20eso%20un%20poco%2C%20probablemente%20no%20cerrar%20la%20tabla%20si%20el%20guardado%20fue%20exitoso%2C%20y%20no%20usar%3CEM%3E%20privado%3C%2FEM%3E%20.%20La%20desventaja%20es%20que%20si%20el%20archivo%20es%20muy%20grande%2C%20el%20guardado%20adicional%20puede%20llevar%20algo%20de%20tiempo%20y%20duplica%20la%20posibilidad%20de%20que%20se%20produzca%20un%20corte%20de%20energ%C3%ADa%20durante%20el%20guardado%2C%20lo%20que%20corromper%C3%ADa%20los%20datos.%20(Para%20FileSnapper%2C%20el%20archivo%20es%20un%20centinela%2C%20peque%C3%B1o%2C%20a%20punto%20de%20eliminarse%20y%20volver%20a%20crearse%20cada%20vez%2C%20por%20lo%20que%20funciona%20correctamente).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-341045%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20un%20mensaje%20de%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-341045%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EOk%2C%20gracias%20por%20investigar%20a%20este%20Craig.%3C%2FP%3E%3CP%3EIntentar%C3%A9%20configurar%20el%20script%20de%20David%20en%20mi%20archivo%20JMP.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-339926%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20un%20mensaje%20de%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339926%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EMmm.%20Puedo%20ver%20que%20funciona%20en%20JMP%2014%2C%20pero%20tal%20vez%20no%20en%2015.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-339904%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20un%20mensaje%20de%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339904%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEl%20script%20de%20David%20tiene%20el%20c%C3%B3digo%20que%20verifica%20la%20indicaci%C3%B3n%20visible%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20style%3D%22width%3A%20493px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F28764iB52CA662BB094D01%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22LockedFile.PNG%22%20alt%3D%22Several%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ESeveral%20copies%20of%20JMP%20open%2C%20same%20table%20in%20two%20copies%2C%20one%20of%20them%20is%20locked%20out%20by%20the%20other.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EVarias%20copias%20de%20JMP%20abiertas%2C%20misma%20tabla%20en%20dos%20copias%2C%20una%20de%20ellas%20bloqueada%20por%20la%20otra.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-339902%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20un%20mensaje%20de%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339902%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EGracias%20por%20la%20respuesta%20Craige.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%C2%BFSer%C3%ADa%20posible%20generar%20un%20mensaje%2Fadvertencia%20de%20que%20otra%20persona%20ya%20est%C3%A1%20utilizando%20el%20archivo%3F%20Actualmente%2C%20el%20segundo%20usuario%20podr%C3%ADa%20no%20saber%20que%20otro%20usuario%20ya%20abri%C3%B3%20el%20archivo.%20Entonces%2C%20si%20el%20segundo%20usuario%20realiza%20cambios%20en%20el%20archivo%2C%20estos%20cambios%20no%20se%20pueden%20guardar%20en%20el%20archivo%20original.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-339880%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20un%20mensaje%20de%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-339880%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EUna%20tabla%20JMP%20est%C3%A1%20bloqueada%20para%20escritura%20por%20el%20primer%20usuario%20que%20la%20abre.%20Los%20usuarios%20subsiguientes%20obtienen%20acceso%20de%20solo%20lectura%20(no%20pueden%20guardar%20sus%20cambios).%20La%20secuencia%20de%20comandos%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4536%22%20target%3D%22_blank%22%3E%20%40David_Burnham%3C%2FA%3E%20write%20asume%20que%20el%20usuario%20con%20el%20candado%20cerrar%C3%A1%20la%20tabla%20bastante%20pronto%20(200%20intentos)%20y%20luego%20abre%20la%20tabla%20para%20el%20nuevo%20usuario%2C%20que%20deber%C3%ADa%20obtener%20el%20candado%20para%20el%20nuevo%20usuario.%20Podr%C3%ADa%20funcionar%20bastante%20bien%20para%202%20o%203%20usuarios%20que%20usan%20un%20programa%20cuidadosamente%20escrito%20para%20actualizar%20la%20tabla.%20No%20es%20para%20un%20usuario%20que%20pueda%20abrir%20la%20mesa%20y%20luego%20ir%20a%20almorzar%20sin%20cerrarla.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-743872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20el%20mensaje%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-743872%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%C2%BFPuedes%20publicar%20la%20prueba%3F%20%C2%BFY%20el%20archivo%20es%20un%20archivo%20de%20red%20o%20un%20archivo%20local%3F%20No%20estoy%20seguro%20de%20qu%C3%A9%20podr%C3%ADan%20hacer%20diferente%20JMP%20o%20el%20sistema%20operativo%2C%20pero%20al%20menos%20a%20veces%20creo%20que%20JMP%20guarda%20en%20un%20archivo%20alternativo%2C%20luego%20elimina%2Fcambia%20el%20nombre%2Fintercambia%20para%20que%20la%20ventana%20de%20una%20falla%20de%20energ%C3%ADa%20sea%20lo%20m%C3%A1s%20peque%C3%B1a%20posible.%20Podr%C3%ADa%20ser%20que%20el%20proceso%20se%20est%C3%A9%20interponiendo.%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3022%22%20target%3D%22_blank%22%3E%40briancorcoran%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-744192%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20el%20mensaje%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-744192%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ELos%20problemas%20son%20peores%20con%20una%20unidad%20de%20red%20(en%20mi%20caso)%20con%20un%20archivo%20en%20OneDrive.%20Pero%20mis%20pruebas%20han%20sido%20con%20un%20archivo%20local.%20Windows%2010%2C%20JMP%2017.%3C%2FP%3E%0A%3CP%3ELos%20scripts%20%22locktest1%22%20y%20%22locktest2%22%20son%20id%C3%A9nticos%20excepto%20que%20el%20primer%20script%20actualiza%20la%20columna%201%20de%20la%20tabla%20de%20resultados%20mientras%20que%20el%20segundo%20script%20actualiza%20la%20columna%202.%3C%2FP%3E%0A%3CP%3EAl%20ejecutar%20cada%20script%20simult%C3%A1neamente%20en%20instancias%20JMP%20separadas%2C%20es%20posible%20probar%20la%20l%C3%B3gica%20para%20manejar%20bloqueos%20de%20archivos.%3C%2FP%3E%0A%3CP%3ELa%20l%C3%ADnea%2075%20de%20los%20scripts%20contiene%20la%20ruta%20de%20la%20tabla%20de%20resultados.%20Coloque%20la%20tabla%20de%20resultados%20en%20una%20ubicaci%C3%B3n%20adecuada%20y%20actualice%20la%20variable%20de%20ruta%20para%20que%20apunte%20a%20esta%20ubicaci%C3%B3n.%3C%2FP%3E%0A%3CP%3EAbra%20una%20sesi%C3%B3n%20JMP%20y%20abra%20locktest1.%20Muestra%20el%20registro%20incrustado.%3C%2FP%3E%0A%3CP%3EAbra%20una%20segunda%20sesi%C3%B3n%20JMP%20y%20abra%20loctest2%2C%20con%20un%20registro%20integrado.%3C%2FP%3E%0A%3CP%3EEjecute%20los%20dos%20scripts%20(yo%20ejecuto%20el%20primero%2C%20espero%20hasta%20que%20el%20registro%20muestre%20i%3D5%20y%20luego%20ejecuto%20el%20segundo%2C%20pero%20eso%20es%20s%C3%B3lo%20superstici%C3%B3n).%3C%2FP%3E%0A%3CP%3EEl%20bucle%20definido%20en%20la%20l%C3%ADnea%2079%20realiza%2050%20iteraciones.%20Si%20los%20dos%20scripts%20finalizan%20exitosamente%2C%20el%20resultado%20deber%C3%ADa%20ser%20que%20la%20tabla%20de%20resultados%20contenga%20n%C3%BAmeros%20del%201%20al%2050%20en%20cada%20una%20de%20las%20dos%20columnas.%3C%2FP%3E%0A%3CP%3EHay%20un%20script%20de%20tabla%20que%20le%20permitir%C3%A1%20restablecer%20el%20contenido%20de%20la%20tabla.%3C%2FP%3E%0A%3CP%3EEn%20la%20pr%C3%A1ctica%2C%20existen%203%20posibles%20modos%20de%20fallo%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ESe%20muestran%20uno%20o%20m%C3%A1s%20mensajes%20de%20%22no%20se%20puede%20obtener%20el%20marcador%20de%20fin%20de%20archivo%22.%20Este%20error%20ocurre%20al%20guardar%20y%20no%20es%20posible%20guardar%20los%20resultados.%20Por%20lo%20tanto%2C%20faltar%C3%A1n%20algunos%20valores%20en%20la%20tabla%20de%20resultados.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3EEn%20alg%C3%BAn%20momento%2C%20la%20tabla%20de%20resultados%20desaparecer%C3%A1.%20Si%20no%20se%20puede%20encontrar%20el%20archivo%2C%20los%20scripts%20cancelan%20la%20ejecuci%C3%B3n%20con%20un%20mensaje%20de%20%22archivo%20no%20encontrado%22.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLI%3E%0A%3CLI%3EEn%20ocasiones%2C%20ambos%20scripts%20no%20logran%20bloquear%20la%20mesa.%20Esto%20lo%20indican%20ambos%20scripts%20que%20realizan%20500%20intentos%20para%20obtener%20un%20bloqueo.%20Si%20cancela%20los%20scripts%20y%20luego%20intenta%20abrir%20la%20tabla%20de%20resultados%2C%20tendr%C3%A1%20una%20variable%20de%20tabla%20%3CEM%3Efile_lock%3C%2FEM%3E%20.%20Ambas%20instancias%20de%20JMP%20tendr%C3%A1n%20la%20tabla%20bloqueada.%20La%20%C3%BAnica%20forma%20de%20desbloquearlo%20es%20cerrar%20ambas%20sesiones%20de%20JMP.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EGeneralmente%2C%2050%20iteraciones%20son%20suficientes%20para%20observar%20(1)%20y%20(2)%2C%20pero%20ocasionalmente%20es%20necesario%20aumentar%20el%20n%C3%BAmero%20de%20iteraciones%20para%20ver%20(2).%20El%20escenario%20(3)%20es%20m%C3%A1s%20probable%20con%20cientos%20de%20iteraciones%20y%20sin%20la%20espera%20en%20la%20l%C3%ADnea%20100.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-743739%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20el%20mensaje%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-743739%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDurante%20las%20pruebas%2C%20encuentro%20un%20escenario%20en%20el%20que%20puedo%20abrir%20la%20tabla%20sin%20ning%C3%BAn%20mensaje%20en%20%3CSTRONG%3Eel%20registro%20de%20guardado%3C%2FSTRONG%3E%20%2C%20pero%20cuando%20llego%20a%20guardar%20aparece%20el%20error%20%22No%20se%20puede%20obtener%20el%20marcador%20de%20fin%20de%20archivo%22.%20Esto%20no%20s%C3%B3lo%20impide%20que%20se%20guarden%20los%20datos%20m%C3%A1s%20recientes%2C%20sino%20que%20todo%20el%20archivo%20desaparece%20y%20se%20pierden%20todos%20los%20datos.%3C%2FP%3E%0A%3CP%3EEn%20el%20entorno%20de%20prueba%20tengo%202%20scripts%2C%20id%C3%A9nticos%20excepto%20que%20un%20script%20actualiza%20la%20primera%20columna%20de%20la%20tabla%20y%20el%20segundo%20script%20actualiza%20la%20segunda%20columna.%20Cada%20script%20intenta%20actualizar%20la%20tabla%20100%20veces.%20Si%20la%20apertura%20informa%20(a%20trav%C3%A9s%20de%20%3CEM%3Esavelog%3C%2FEM%3E%20)%20que%20la%20tabla%20est%C3%A1%20bloqueada%2C%20entonces%20espera%20y%20vuelve%20a%20intentarlo%20(seg%C3%BAn%20las%20l%C3%ADneas%20de%20mi%20script%20original).%20Sin%20embargo%2C%20tal%20vez%20una%20o%20dos%20veces%20de%20cada%20100%20intentos%20se%20produzca%20un%20error%20de%20marcador%20de%20fin%20de%20archivo.%20Esto%20puede%20ocurrir%20al%20abrir%20el%20archivo%20(con%20la%20prueba%20%3CEM%3Edel%20registro%20de%20guardado%3C%2FEM%3E%20)%20o%20al%20guardar%20los%20resultados%20(cerrar%20y%20guardar%20suponiendo%20que%20hay%20acceso%20de%20escritura).%20Implement%C3%A9%20una%20prueba%20%3CEM%3Ede%20registro%20de%20guardado%3C%2FEM%3E%20similar%20al%20cerrar%2C%20pero%20para%20entonces%20ya%20es%20demasiado%20tarde%2C%20el%20da%C3%B1o%20ya%20est%C3%A1%20hecho.%3C%2FP%3E%0A%3CP%3EMi%20experiencia%20con%20este%20error%20es%20que%20si%20lo%20recibes%20al%20intentar%20guardar%20los%20resultados%2C%20est%C3%A1s%20en%20un%20gran%20problema%20y%20corres%20el%20riesgo%20de%20perder%20la%20tabla%20por%20completo.%20As%C3%AD%20que%20trato%20de%20concentrarme%20en%20eliminar%20el%20error%20que%20ocurre%20en%20primera%20instancia%20tratando%20de%20obtener%20acceso%20de%20lectura%20y%20escritura%20de%20manera%20confiable%20al%20abrir%20la%20tabla.%20El%2099%25%20de%20las%20veces%20lo%20logro%2C%20pero%20eventualmente%20siempre%20puedo%20obtener%20el%20error.%20Sospecho%20que%20lo%20que%20sucede%20es%20que%20existe%20una%20peque%C3%B1a%20posibilidad%20de%20que%20ambos%20scripts%20obtengan%20acceso%20de%20lectura%20y%20escritura%20al%20archivo%20(al%20menos%2C%20seg%C3%BAn%20lo%20informado%20por%20savelog)%2C%20pero%20en%20alg%C3%BAn%20momento%20un%20script%20mantiene%20el%20acceso%20de%20lectura%20y%20escritura%20y%20el%20otro%20script%20finaliza%20el%20archivo.%20error%20de%20marcador%20(probablemente%20cuando%20el%20otro%20script%20ha%20realizado%20una%20actualizaci%C3%B3n).%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749493%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20C%C3%B3mo%20mostrar%20el%20mensaje%20%22Archivo%20en%20uso%22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749493%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ELo%20siento%2C%20perd%C3%AD%20la%20pista%20de%20esto.%20Hice%20un%20v%C3%ADdeo%20de%20la%20tabla%20de%20datos%20desapareciendo%20del%20escritorio%20y%20se%20lo%20envi%C3%A9%20al%20equipo%20de%20desarrollo.%20%C2%A1Gracias!%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
RobRobeyns
Level III

How to prompt a " File in Use" message

Hi,

 

I'm currently creating a JMP file which acts as a database. Therefore I would like to prompt a "File in use" message and keep the file locked for editing when someone else already opened the database and is making changes to the file. For example, the same message you get when you open an Excel file on a server location that is already in use by someone else:

 

file in use message.png

 

 

 

 

I think I already found a part of the answer in the following Community post: Multi-User Access 

 

If I'm correct I would still need to figure out how to lock the table if it is opened by another user.

 

Could someone please help with creating such a script?

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: How to prompt a " File in Use" message

David's script has the code that checks for the visible indication:

Several copies of JMP open, same table in two copies, one of them is locked out by the other.Several copies of JMP open, same table in two copies, one of them is locked out by the other.

Craige

View solution in original post

10 REPLIES 10
Craige_Hales
Super User

Re: How to prompt a " File in Use" message

A JMP table is locked for writing by the first user that opens it. Subsequent users get read-only access (they can't save their changes). The script @David_Burnham wrote assumes the user with the lock will close the table fairly soon (200 tries) and then opens the table for the new user, which should get the lock for the new user. It might work pretty well for 2 or 3 users that use a carefully written program to update the table. It is not for a user that might open the table then go to lunch without closing it.

Craige
RobRobeyns
Level III

Re: How to prompt a " File in Use" message

Thanks for the respons Craige.

 

Would it be possible to prompt a message/warning that the file is already in use by someone else? Currently, the second user could be unaware that the file is already opened by another user. So if the second user makes any changes to the file, these changes cannot be saved to the orginal file.

Craige_Hales
Super User

Re: How to prompt a " File in Use" message

David's script has the code that checks for the visible indication:

Several copies of JMP open, same table in two copies, one of them is locked out by the other.Several copies of JMP open, same table in two copies, one of them is locked out by the other.

Craige
Craige_Hales
Super User

Re: How to prompt a " File in Use" message

Hmm. I can see it works in JMP 14, but maybe not 15.

 

Craige
RobRobeyns
Level III

Re: How to prompt a " File in Use" message

Ok, thanks for looking into this Craig.

I'll try setting up the script from David in my JMP file.

Craige_Hales
Super User

Re: How to prompt a " File in Use" message

It will probably work in JMP 14. I reported the JMP 15/16 issue I was seeing. 

If you must make it work in 15, you can do something like this function I used in the FileSnapper add-in.

	FileSnapper:isFileOpenElsewhere = Function( {filepath}, {dt, savelog},
		If( endswith(filepath,".jmp") & File Exists( filepath ),
			dt = Open( filepath, private );		
			savelog = Log Capture( dt << save );
			close(dt,"nosave");
			Length( savelog ) != 0; // error message means another JMP has dt open
		, // else
			0 // not open if not exists	
		)
	);

It works by trying to save the file as soon as it is opened and catching the log message. If there is no log message, the save worked. You'd want to rearrange that a bit, probably not closing the table if the save was successful, and not using private. The downside is if the file is very big, the extra save might take some time, and it doubles the chance of having a power failure during a save, corrupting the data. (For FileSnapper, the file is a sentinel, small, about to be deleted, and re-created each time, so it works OK.)

Craige
David_Burnham
Super User (Alumni)

Re: How to prompt a " File in Use" message

In testing I'm finding a scenario where I can open the table with no message in savelog, but when I come to save I get a an error "Unable to get End of File marker".  Not only does this prevent the latest data from saving, but the entire file disappears, and all data is lost.

In the test environment I have 2 scripts, identical except one script updates the 1st column of the table and the 2nd script updates the 2nd column.  Each script attempts the update the table 100 times.  If the open reports (via savelog) that the table is locked then it waits and re-attempts (along the lines of my original script). However, maybe once or twice   in the 100 attempts there will be an end of file marker error.  This might occur when opening the file (with the savelog test) or when saving the results (closing and saving on the assumption that there is write access).  I've implemented a similar savelog test on close, but by then it is too late, the damage is done.

My experience of this error is that if you get it when trying to save results you're in big trouble and risk losing the table entirely.  So I try and focus on eliminating the error occurring in the first instance by trying to reliably gain read-write access when opening the table.  99% of the time I achieve this, but I can always get the error eventually.  I suspect what happens is that there is a slim chance that both scripts get read-write access to the file (atleast, as reported by savelog) but at some point one script keeps read-write access and the other script gets an end of file marker error - probably when the other script has made an update).

 

-Dave
Craige_Hales
Super User

Re: How to prompt a " File in Use" message

Can you post the test? And is the file a network file or a local file? I'm not sure what JMP or the OS might do differently, but at least sometimes I think JMP saves to an alternate file, then deletes/renames/swaps to make the window for a power loss failure as small as possible. It could be that process is getting in the way. @briancorcoran 

Craige
David_Burnham
Super User (Alumni)

Re: How to prompt a " File in Use" message

The problems are worse with a network drive (or in my instance with a file on OneDrive).  But my testing has been with a local file.  Windows 10,, JMP 17.

The scripts “locktest1” and “locktest2” are identical except that the first script updates column 1 of the results table whereas the second script updates the column 2.

By running each script simultaneously in separate JMP instances it is possible to stress-test the logic for handling file-locks.

Line 75 of the scripts contains the path for the results table.  Place the results table in a suitable location and update the path variable to point to this location.

Open a JMP session and open locktest1.  Show the embedded log.

Open a second JMP session and open locktest2, with an embedded log.

Run the two scripts (I run the first, wait until the log shows i=5 and then run the second, but that is just superstition).

The loop defined on line 79 performs 50 iterations.  If the two scripts finish successfully then the outcome should be that the results table contains numbers 1 to 50 in each of the two columns.

There is a table script that will allow you to reset the table contents.

In practice, there are 3 possible failure modes:

  1. One or more “unable to get end of file marker” messages are displayed.  This error occurs when saving, and it is not possible to save the results.  Therefore there will be some missing values in the results table. 

  2. At some point, the results table will vanish.  If the file cannot be found the scripts abort execution with a “file not found” message.

  3. Occasionally, both scripts fail to get a lock on the table.  This is indicated by both scripts making 500 attempts to get a lock.  If you abort the scripts, and then try opening the results table, it will have a file_lock table variable.  Both instances of JMP will have the table locked.  The only way to unlock it is to close both sessions of JMP.

50 iterations is usually sufficient to observe (1) and (2) but occasionally you need to increase the number of iterations to see (2).  Scenario (3) is more likely with 100s of iterations and with the wait on line 100 removed.

 

David_Burnham_0-1712181329641.png

 

-Dave