Author: rareddy
Date: 2010-07-28 15:17:38 -0400 (Wed, 28 Jul 2010)
New Revision: 2389
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
Log:
TEIID-1104
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2010-07-28
19:04:04 UTC (rev 2388)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/process/SessionAwareCache.java 2010-07-28
19:17:38 UTC (rev 2389)
@@ -61,7 +61,7 @@
SessionAwareCache (int maxSize, final CacheFactory cacheFactory, final Cache.Type
type){
if(maxSize < 0){
- this.maxSize = DEFAULT_MAX_SIZE_TOTAL;
+ maxSize = DEFAULT_MAX_SIZE_TOTAL;
}
this.maxSize = maxSize;
this.localCache = new DefaultCache<CacheID, T>("local", maxSize);
//$NON-NLS-1$
@@ -133,7 +133,7 @@
private String sessionId;
private String originalSessionId;
private List<Serializable> parameters;
- private String userName;
+ //private String userName;
boolean cachable = true;
CacheID(DQPWorkContext context, ParseInfo pi, String sql){
@@ -141,7 +141,7 @@
this.vdbInfo = new VDBKey(context.getVdbName(), context.getVdbVersion());
this.pi = pi;
this.originalSessionId = context.getSessionId();
- this.userName = context.getUserName();
+ //this.userName = context.getUserName();
}
private void setSessionId(String sessionId) {
@@ -163,7 +163,7 @@
}
public void setUserName(String name) {
- this.userName = name;
+ //this.userName = name;
}
public boolean equals(Object obj){
@@ -175,13 +175,13 @@
}
CacheID that = (CacheID)obj;
return this.pi.equals(that.pi) && this.vdbInfo.equals(that.vdbInfo)
&& this.sql.equals(that.sql)
- && EquivalenceUtil.areEqual(this.userName, that.userName)
+ //&& EquivalenceUtil.areEqual(this.userName, that.userName)
&& EquivalenceUtil.areEqual(this.sessionId, that.sessionId)
&& EquivalenceUtil.areEqual(this.parameters, that.parameters);
}
public int hashCode() {
- return HashCodeUtil.hashCode(0, vdbInfo, sql, pi, sessionId, parameters);
+ return HashCodeUtil.hashCode(0, vdbInfo, sql, pi, sessionId, parameters);
}
@Override
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2010-07-28
19:04:04 UTC (rev 2388)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestPreparedStatement.java 2010-07-28
19:17:38 UTC (rev 2389)
@@ -159,7 +159,8 @@
@Test public void testSessionSpecificFunction() throws Exception {
// Create query
- String preparedSql = "SELECT user(), e2, pm1.g1.e3 as a, e4 as b FROM pm1.g1
WHERE e2=?"; //$NON-NLS-1$
+ System.setProperty("foo", "foo"); //$NON-NLS-1$ //$NON-NLS-2$
+ String preparedSql = "SELECT env('foo'), e2, pm1.g1.e3 as a, e4 as b
FROM pm1.g1 WHERE e2=?"; //$NON-NLS-1$
// Create expected results
List[] expected = new List[] {
Show replies by date