Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion JasperReports/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<target name="compile" depends="makedir">
<!-- compile the java code from ${src} into ${build.dir} -->
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on">
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on" includeantruntime="false">
<classpath>
<pathelement path="${classpath}"/>
<pathelement path="../client/build"/>
Expand Down
2 changes: 1 addition & 1 deletion JasperReportsWebApp/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<target name="compile">
<echo>------ Compiling webApp</echo>
<mkdir dir="${build.dir}"/>
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on">
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
</target>
Expand Down
2 changes: 1 addition & 1 deletion base/src/org/compiere/model/MProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public List<MProcessPara> getParametersAsList(String optionalWhereClause) {
&& optionalWhereClause.trim().length() > 0)
whereClause.append(" AND ").append(optionalWhereClause);
//
List<MProcessPara> list = new Query(getCtx(), I_AD_Process_Para.Table_Name, whereClause.toString(), get_TrxName())
List<MProcessPara> list = new Query(getCtx(), I_AD_Process_Para.Table_Name, whereClause.toString(), null)
.setParameters(get_ID())
.setOnlyActiveRecords(true)
.setOrderBy(MProcessPara.COLUMNNAME_SeqNo)
Expand Down
10 changes: 5 additions & 5 deletions base/src/org/compiere/model/MRole.java
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ private void loadTableInfo (boolean reload)
+ "FROM AD_Table WHERE IsActive='Y'";
try
{
pstmt = DB.prepareStatement(sql, get_TrxName());
pstmt = DB.prepareStatement(sql, null);
rs = pstmt.executeQuery();
while (rs.next())
{
Expand Down Expand Up @@ -925,7 +925,7 @@ private void loadRecordAccess(boolean reload) {
whereClause = "(AD_Role_ID=? OR AD_User_ID = " + m_AD_User_ID + ")";
}
// Add standard access
new Query(getCtx(), I_AD_Record_Access.Table_Name, whereClause, get_TrxName())
new Query(getCtx(), I_AD_Record_Access.Table_Name, whereClause, null)
.setParameters(getAD_Role_ID())
.setOnlyActiveRecords(true)
.setOrderBy(I_AD_Record_Access.COLUMNNAME_AD_Table_ID)
Expand Down Expand Up @@ -1498,7 +1498,7 @@ public Boolean getWindowAccess (int AD_Window_ID)
ResultSet rs = null;
try
{
pstmt = DB.prepareStatement(sql, get_TrxName());
pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, getAD_Role_ID());
rs = pstmt.executeQuery();
while (rs.next())
Expand Down Expand Up @@ -2926,7 +2926,7 @@ private void loadChildRoles(boolean reload)
}
//
final String whereClause = X_AD_Role_Included.COLUMNNAME_AD_Role_ID+"=?";
List<X_AD_Role_Included> list = new Query(getCtx(), X_AD_Role_Included.Table_Name, whereClause, get_TrxName())
List<X_AD_Role_Included> list = new Query(getCtx(), X_AD_Role_Included.Table_Name, whereClause, null)
.setParameters(new Object[]{getAD_Role_ID()})
.setOnlyActiveRecords(true)
.setOrderBy(
Expand Down Expand Up @@ -2967,7 +2967,7 @@ private void loadSubstitutedRoles(boolean reload)
+" AND (us.ValidFrom IS NULL OR us.ValidFrom <= getdate())"
+" AND (us.ValidTo IS NULL OR us.ValidTo >= getdate())"
+" AND us.Substitute_ID=?)";
List<MRole> list = new Query(getCtx(), Table_Name, whereClause, get_TrxName())
List<MRole> list = new Query(getCtx(), Table_Name, whereClause, null)
.setParameters(new Object[]{AD_User_ID})
.setClient_ID()
.setOrderBy(COLUMNNAME_AD_Role_ID)
Expand Down
4 changes: 0 additions & 4 deletions base/src/org/compiere/model/MSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ else if (DB.isOracle())

// Get the table
MTable table = MTable.get(Env.getCtx(), TableName);
// Set the transaction from Persistence Object avoid null transaction error
if (table.get_TrxName() == null && trxName != null)
table.set_TrxName(trxName);

int AD_Sequence_ID = rs.getInt(4);
boolean gotFromHTTP = false;

Expand Down
12 changes: 3 additions & 9 deletions base/src/org/compiere/model/MTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,14 @@ public static MTable get (Properties ctx, int AD_Table_ID)
* @param tableName case insensitive table name
* @return Table
*/
public static MTable get (Properties ctx, String tableName)
{
public static MTable get (Properties ctx, String tableName) {
if (tableName == null)
return null;
int tableId = getTable_ID(tableName);
if(tableId <= 0) {
return null;
}
MTable retValue = MTable.get(ctx, tableId);
if (retValue != null) {
Integer key = new Integer (retValue.getAD_Table_ID());
s_cache.put (key, retValue);
}
return retValue;
return MTable.get(ctx, tableId);
} // get

/**
Expand Down Expand Up @@ -447,7 +441,7 @@ public List<MColumn> getColumnsAsList(boolean requery) {
return columns;
}
// Default find
columns = new Query(getCtx(), I_AD_Column.Table_Name, "AD_Table_ID = ?", get_TrxName())
columns = new Query(getCtx(), I_AD_Column.Table_Name, "AD_Table_ID = ?", null)
.setParameters(getAD_Table_ID())
.setOrderBy(I_AD_Column.COLUMNNAME_ColumnName)
.list();
Expand Down
25 changes: 25 additions & 0 deletions base/src/org/compiere/model/PO.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,24 @@ public abstract class PO
private static final String USE_TIMEOUT_FOR_UPDATE = "org.adempiere.po.useTimeoutForUpdate";

private static final int QUERY_TIME_OUT = 10;
private boolean isCachedEntity = false;


/**
* Validate if this PO is managed from cache
* @return
*/
public final boolean isCachedEntity() {
return isCachedEntity;
}

/**
* Set value for cache flag
* @param isCachedEntity
*/
public final void setIsCachedEntity(boolean isCachedEntity) {
this.isCachedEntity = isCachedEntity;
}

/**
* get instance based on table id , record id and trxName
Expand Down Expand Up @@ -3817,6 +3835,10 @@ public boolean unlock (String trxName)
*/
public void set_TrxName (String trxName)
{
if(isCachedEntity()
&& trxName!= null) {
throw new AdempiereException("Transaction not allowed for cache objects PO: " + this);
}
m_trxName = trxName;
} // setTrx

Expand All @@ -3826,6 +3848,9 @@ public void set_TrxName (String trxName)
*/
public String get_TrxName()
{
if(isCachedEntity()) {
throw new AdempiereException("Transaction not allowed for cache objects PO: " + this);
}
return m_trxName;
} // getTrx

Expand Down
15 changes: 14 additions & 1 deletion base/src/org/compiere/util/CCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import org.compiere.model.PO;

/**
* Adempiere Cache.
Expand Down Expand Up @@ -228,7 +229,12 @@ public Set<Map.Entry<K,V>> entrySet()
public V get(Object key)
{
expire();
return super.get(key);
V value = super.get(key);
if(value != null && PO.class.isAssignableFrom(value.getClass())) {
PO entity = (PO) value;
entity.setIsCachedEntity(true);
}
return value;
} // get

/**
Expand All @@ -241,6 +247,13 @@ public V put (K key, V value)
{
expire();
m_justReset = false;
if(value == null) {
return super.remove(key);
}
if(PO.class.isAssignableFrom(value.getClass())) {
PO entity = (PO) value;
entity.setIsCachedEntity(true);
}
return super.put (key, value);
} // put

Expand Down
2 changes: 1 addition & 1 deletion client/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<!-- =========================================== -->
<target name="clientCompile" depends="clientMakedir">
<!-- compile the java code from ${src} into ${build.dir} -->
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on">
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<!-- copy all image & sound files from src to the build directory -->
Expand Down
2 changes: 1 addition & 1 deletion com.kkalice.adempiere.migrate/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<!-- =========================================== -->
<target name="migrateCompile" depends="migrateInit" unless="jar.uptodate">
<!-- compile the java code -->
<javac srcdir="${source.dir}" destdir="${build.dir}" includeAntRuntime="false">
<javac srcdir="${source.dir}" destdir="${build.dir}" includeantruntime="false">
<classpath refid="project.class.path" />
</javac>
<!-- copy all image & sound files from source to the build directory -->
Expand Down
2 changes: 1 addition & 1 deletion extend/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

<target name="compile" depends="makedir">
<!-- compile the java code from ${src} into ${build.dir} -->
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on">
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<!-- copy all image & sound files from src to the build directory -->
Expand Down
2 changes: 1 addition & 1 deletion install/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<!-- ======================================================= -->
<target name="installCompile" depends="installInit">
<!-- compile the java code from ${src} into ${build.dir} -->
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${compile.dir}" deprecation="on" debug="on">
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${compile.dir}" deprecation="on" debug="on" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<!-- copy all image & sound files from src to the build directory -->
Expand Down
2 changes: 1 addition & 1 deletion org.adempiere.asset/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac encoding="UTF-8" srcdir="${src}" destdir="${build}">
<javac encoding="UTF-8" srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="lib.class.path"/>
</javac>

Expand Down
2 changes: 1 addition & 1 deletion org.adempiere.production/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<!-- =========================================== -->
<target name="productionCompile" depends="productionMakedir">
<!-- compile the java code from ${src} into ${build.dir} -->
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on">
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<!-- copy all image & sound files from src to the build directory -->
Expand Down
3 changes: 2 additions & 1 deletion org.adempiere.webservice/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
destdir="${classes.dir}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
optimize="${compile.optimize}"
includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
<copy todir="${classes.dir}">
Expand Down
3 changes: 2 additions & 1 deletion org.compiere.mobile/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
destdir="${classes.dir}"
debug="${compile.debug}"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}">
optimize="${compile.optimize}"
includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
<copy todir="${classes.dir}" overwrite="true">
Expand Down
2 changes: 1 addition & 1 deletion org.eevolution.cashflow/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<!-- =========================================== -->
<target name="cashflowCompile" depends="cashflowMakedir">
<!-- compile the java code from ${src} into ${build.dir} -->
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on">
<javac target="11" encoding="UTF-8" srcdir="${src}" destdir="${build.dir}" deprecation="on" debug="on" includeantruntime="false">
<classpath refid="project.class.path"/>
</javac>
<!-- copy all image & sound files from src to the build directory -->
Expand Down
2 changes: 1 addition & 1 deletion org.eevolution.fleet/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac encoding="UTF-8" srcdir="${src}" destdir="${build}">
<javac encoding="UTF-8" srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="lib.class.path"/>
</javac>

Expand Down
4 changes: 2 additions & 2 deletions org.eevolution.freight/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac encoding="UTF-8" srcdir="${src}" destdir="${build}">
<javac encoding="UTF-8" srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="lib.class.path"/>
</javac>

Expand All @@ -71,7 +71,7 @@
<target name="zkcompile" depends="dist"
description="compile the source " >
<!-- Compile the zk java code from ${src} into ${zkclasses} -->
<javac encoding="UTF-8" debug="true" srcdir="${zksrc}" destdir="${zkclasses}">
<javac encoding="UTF-8" debug="true" srcdir="${zksrc}" destdir="${zkclasses}" includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
Expand Down
4 changes: 2 additions & 2 deletions org.eevolution.hr_and_payroll/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac target="11" encoding="UTF-8" fork="true" srcdir="${src}:${srcSwing}" destdir="${build}">
<javac target="11" encoding="UTF-8" fork="true" srcdir="${src}:${srcSwing}" destdir="${build}" includeantruntime="false">
<exclude name="**/org/eevolution/plugin/*.java"/>
<classpath refid="lib.class.path"/>
</javac>
Expand All @@ -78,7 +78,7 @@
description="compile the source " >
<mkdir dir="${zkclasses}"/>
<!-- Compile the zk java code from ${src} into ${zkclasses} -->
<javac srcdir="${zksrc}" destdir="${zkclasses}">
<javac srcdir="${zksrc}" destdir="${zkclasses}" includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
Expand Down
4 changes: 2 additions & 2 deletions org.eevolution.manufacturing/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac encoding="UTF-8" debug="true" srcdir="${src}:${srcSwing}" destdir="${build}">
<javac encoding="UTF-8" debug="true" srcdir="${src}:${srcSwing}" destdir="${build}" includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
Expand All @@ -76,7 +76,7 @@
<target name="zkcompile" depends="dist"
description="compile the source " >
<!-- Compile the zk java code from ${src} into ${zkclasses} -->
<javac encoding="UTF-8" debug="true" srcdir="${zksrc}" destdir="${zkclasses}">
<javac encoding="UTF-8" debug="true" srcdir="${zksrc}" destdir="${zkclasses}" includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
Expand Down
4 changes: 2 additions & 2 deletions org.eevolution.warehouse/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac encoding="UTF-8" srcdir="${src}" destdir="${build}">
<javac encoding="UTF-8" srcdir="${src}" destdir="${build}" includeantruntime="false">
<exclude name="**/org/eevolution/plugin/*.java"/>
<classpath refid="lib.class.path"/>
</javac>
Expand All @@ -73,7 +73,7 @@
<target name="zkcompile" depends="dist"
description="compile the source " >
<!-- Compile the zk java code from ${src} into ${zkclasses} -->
<javac encoding="UTF-8" debug="true" srcdir="${zksrc}" destdir="${zkclasses}">
<javac encoding="UTF-8" debug="true" srcdir="${zksrc}" destdir="${zkclasses}" includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
Expand Down
3 changes: 2 additions & 1 deletion org.spin.finance_management/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
description="compile the source ">
<!-- Compile the java code from ${src} into ${build} -->
<javac encoding="UTF-8" srcdir="${src}" sourcepath="${base}"
destdir="${build}">
destdir="${build}"
includeantruntime="false">
<classpath refid="lib.class.path" />
</javac>

Expand Down
2 changes: 1 addition & 1 deletion org.spin.hr_time_and_attendance/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac encoding="UTF-8" srcdir="${src}" sourcepath="${base}:${ADempiereHR}:${controller}" destdir="${build}">
<javac encoding="UTF-8" srcdir="${src}" sourcepath="${base}:${ADempiereHR}:${controller}" destdir="${build}" includeantruntime="false">
<classpath refid="lib.class.path"/>
</javac>

Expand Down
4 changes: 2 additions & 2 deletions org.spin.loan_management/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<target name="compile" depends="init"
description="compile the source " >
<!-- Compile the java code from ${src} into ${build} -->
<javac encoding="UTF-8" srcdir="${src}" sourcepath="${base}:${FinanceManagement}:${controller}" destdir="${build}">
<javac encoding="UTF-8" srcdir="${src}" sourcepath="${base}:${FinanceManagement}:${controller}" destdir="${build}" includeantruntime="false">
<classpath refid="lib.class.path"/>
</javac>

Expand All @@ -77,7 +77,7 @@
<target name="zkcompile" depends="dist"
description="compile the source " >
<!-- Compile the zk java code from ${src} into ${zkclasses} -->
<javac encoding="UTF-8" debug="true" srcdir="${zksrc}" sourcepath="${base}:${FinanceManagement}:${controller}" destdir="${zkclasses}" >
<javac encoding="UTF-8" debug="true" srcdir="${zksrc}" sourcepath="${base}:${FinanceManagement}:${controller}" destdir="${zkclasses}" includeantruntime="false">
<classpath refid="compile.classpath"/>
</javac>
</target>
Expand Down
Loading