IDEMPIERE-2771 Improve 2pack tracing for errors
This commit is contained in:
parent
e010e5c461
commit
536a21a514
|
@ -835,7 +835,7 @@ public class MColumn extends X_AD_Column
|
|||
|
||||
@Override
|
||||
public I_AD_Table getAD_Table() throws RuntimeException {
|
||||
MTable table = MTable.get(getCtx(), getAD_Table_ID());
|
||||
MTable table = MTable.get(getCtx(), getAD_Table_ID(), get_TrxName());
|
||||
return table;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class MTable extends X_AD_Table
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1776819186412187384L;
|
||||
private static final long serialVersionUID = -8757836873040013402L;
|
||||
|
||||
public final static int MAX_OFFICIAL_ID = 999999;
|
||||
|
||||
|
@ -66,13 +66,27 @@ public class MTable extends X_AD_Table
|
|||
* @return MTable
|
||||
*/
|
||||
public static MTable get (Properties ctx, int AD_Table_ID)
|
||||
{
|
||||
return get(ctx, AD_Table_ID, null);
|
||||
} // get
|
||||
|
||||
/**
|
||||
* Get Table from Cache
|
||||
* @param ctx context
|
||||
* @param AD_Table_ID id
|
||||
* @param trxName transaction
|
||||
* @return MTable
|
||||
*/
|
||||
public static MTable get (Properties ctx, int AD_Table_ID, String trxName)
|
||||
{
|
||||
Integer key = Integer.valueOf(AD_Table_ID);
|
||||
MTable retValue = s_cache.get (key);
|
||||
if (retValue != null && retValue.getCtx() == ctx) {
|
||||
if (trxName != null)
|
||||
retValue.set_TrxName(trxName);
|
||||
return retValue;
|
||||
}
|
||||
retValue = new MTable (ctx, AD_Table_ID, null);
|
||||
retValue = new MTable (ctx, AD_Table_ID, trxName);
|
||||
if (retValue.get_ID () != 0) {
|
||||
s_cache.put (key, retValue);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public final class EMail implements Serializable
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8117458371229316972L;
|
||||
private static final long serialVersionUID = -2489441683920482601L;
|
||||
|
||||
//use in server bean
|
||||
public final static String HTML_MAIL_MARKER = "ContentType=text/html;";
|
||||
|
@ -221,6 +221,8 @@ public final class EMail implements Serializable
|
|||
/** Send result Message */
|
||||
private String m_sentMsg = null;
|
||||
|
||||
private List<ValueNamePair> additionalHeaders = new ArrayList<ValueNamePair>();
|
||||
|
||||
/** Mail Sent OK Status */
|
||||
public static final String SENT_OK = "OK";
|
||||
|
||||
|
@ -344,6 +346,11 @@ public final class EMail implements Serializable
|
|||
// Bounce only header
|
||||
m_msg.setReturnOption (SMTPMessage.RETURN_HDRS);
|
||||
// m_msg.setHeader("X-Mailer", "msgsend");
|
||||
if (additionalHeaders.size() > 0) {
|
||||
for (ValueNamePair vnp : additionalHeaders) {
|
||||
m_msg.setHeader(vnp.getName(), vnp.getValue());
|
||||
}
|
||||
}
|
||||
//
|
||||
setContent();
|
||||
m_msg.saveChanges();
|
||||
|
@ -1202,11 +1209,7 @@ public final class EMail implements Serializable
|
|||
} // main
|
||||
|
||||
public void setHeader(String name, String value) {
|
||||
try {
|
||||
m_msg.setHeader(name, value);
|
||||
} catch (MessagingException e) {
|
||||
log.log(Level.WARNING, m_msg.toString(), e);
|
||||
}
|
||||
additionalHeaders.add(new ValueNamePair(value, name));
|
||||
}
|
||||
|
||||
} // EMail
|
||||
|
|
|
@ -410,7 +410,15 @@ public class PackInHandler extends DefaultHandler {
|
|||
DatabaseMetaData md = conn.getMetaData();
|
||||
String catalog = DB.getDatabase().getCatalog();
|
||||
String schema = DB.getDatabase().getSchema();
|
||||
MTable table = MTable.get(m_ctx.ctx, column.getAD_Table_ID());
|
||||
MTable table = MTable.get(m_ctx.ctx, column.getAD_Table_ID(), m_ctx.trx.getTrxName());
|
||||
if (table.get_ID() != column.getAD_Table_ID()) {
|
||||
// table not found
|
||||
log.warning("Table " + column.getAD_Table_ID() + " not found");
|
||||
continue;
|
||||
}
|
||||
if (table.isView()) {
|
||||
continue;
|
||||
}
|
||||
String tableName = table.getTableName();
|
||||
|
||||
String fkConstraintSql = MColumn.getForeignKeyConstraintSql(md, catalog, schema, tableName, table, column, false);
|
||||
|
|
|
@ -148,8 +148,11 @@ public class PackInNotifier {
|
|||
EMail email = client.createEMail(null, to, subject.toString(), message.toString());
|
||||
if (email != null)
|
||||
{
|
||||
if (!packIn.isSuccess())
|
||||
if (!packIn.isSuccess()) {
|
||||
email.setHeader("X-Priority", "1");
|
||||
email.setHeader("Priority","Urgent");
|
||||
email.setHeader("Importance","high");
|
||||
}
|
||||
while (st.hasMoreTokens())
|
||||
email.addTo(st.nextToken());
|
||||
status = email.send();
|
||||
|
|
Loading…
Reference in New Issue