Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Mal uso de transacción dentro de un proceso #43

Open
yamelsenih opened this issue Jul 22, 2023 · 0 comments
Open

[Bug Report] Mal uso de transacción dentro de un proceso #43

yamelsenih opened this issue Jul 22, 2023 · 0 comments
Labels
bug Something isn't working Publicado

Comments

@yamelsenih
Copy link

yamelsenih commented Jul 22, 2023

Bug report

En el proceso de Setup Storage for Files System cuando se exportan los adjuntos no está tomando la transacción creada para cada adjunto, en su lugar toma la del proceso.

int attachmentReferenceId = DB.getSQLValue(get_TrxName(), "SELECT AD_AttachmentReference_ID "
											+ "FROM AD_AttachmentReference "
											+ "WHERE AD_Attachment_ID = ? "
											+ "AND FileName = ? "
											+ "AND FileHandler_ID = ?", attachmentPair.getKey(), entry.getName(), getAppSupportId());
									if(attachmentReferenceId < 0) {
										try {
											AttachmentUtil.getInstance(getCtx())
												.withData(entry.getData())
												.withAttachmentId(attachmentPair.getKey())
												.withFileName(entry.getName())
												.withDescription(Msg.getMsg(getCtx(), "CreatedFromSetupExternalStorage"))
												.withFileHandlerId(getFileHandlerId())
												.saveAttachment();
											addLog(entry.getName() + ": @Ok@");
											processed.incrementAndGet();
										} catch (Exception e) {
											log.warning("Error: " + e.getLocalizedMessage());
											addLog("@ErrorProcessingFile@ " + entry.getName() + ": " + e.getLocalizedMessage());
											errors.incrementAndGet();
										}
									} else {
										addLog(entry.getName() + ": @Ignored@");
										ignored.incrementAndGet();
									}
								}

En el siguiente fragmento debería usar la variable trxName en lugar del método get_TrxName()

int attachmentReferenceId = DB.getSQLValue(get_TrxName(), 

Steps to reproduce

  1. Vaya a System Admin -> General Rules -> Setup Storage for Files System

Screenshot or Gif

Link to minimal reproduction

Expected behavior

Cuando Se ejecuta el proceso en paraleo no debería tomar en cuenta los archivos que ya se movieron.

Other relevant information

  • Your OS:
  • Java version:
  • ADempiere version:
  • Browser [e.g. chrome, safari]
  • Browser Version [e.g. 22]
  • DB Provider:
  • DB version:

Additional context

Add any other context about the problem here.
adempiere#4243

@yamelsenih yamelsenih added the bug Something isn't working label Jul 22, 2023
yamelsenih added a commit that referenced this issue Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Publicado
Projects
None yet
Development

No branches or pull requests

1 participant