[JBoss JIRA] Created: (ISPN-1359) SetExternalizer Cannot Properly Handle TreeSets Constructed With Comparator
by Ryan Scharer (JIRA)
SetExternalizer Cannot Properly Handle TreeSets Constructed With Comparator
---------------------------------------------------------------------------
Key: ISPN-1359
URL: https://issues.jboss.org/browse/ISPN-1359
Project: Infinispan
Issue Type: Bug
Components: Marshalling
Affects Versions: 5.0.0.FINAL
Environment: OSX 10.7.1, System JDK
Reporter: Ryan Scharer
Assignee: Manik Surtani
TreeSets can be used to hold objects that don't implement Comparable, so long as you provide a Comparator during construction. The current implementation of SetExternalizer doesn't support this pattern... trying to deserialize a TreeSet that holds objects that don't implement Comparable results in a ClassCastException. This seriously reduces the flexibility of TreeSet.
JBoss Cache doesn't have this limitation, presumably because it delegates to native Java serialization.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (ISPN-604) Re-design CacheStore transactions
by Mircea Markus (JIRA)
Re-design CacheStore transactions
----------------------------------
Key: ISPN-604
URL: https://jira.jboss.org/browse/ISPN-604
Project: Infinispan
Issue Type: Feature Request
Components: Loaders and Stores, Transactions
Affects Versions: 4.1.0.CR2, 4.0.0.Final
Reporter: Mircea Markus
Assignee: Mircea Markus
Fix For: 5.0.0.Final
Current(4.1.x) transaction implementation in CacheStores is brocken in several ways:
1st problem.
- AbstractCacheStore.prepare:
public void prepare(List<? extends Modification> mods, GlobalTransaction tx, boolean isOnePhase) throws CacheLoaderException {
if (isOnePhase) {
applyModifications(mods);
} else {
transactions.put(tx, mods);
}
}
If this is 1PC we apply the modifications in the prepare phase - we should do it in the commit phase (as JTA does it).
2nd problem.
This currently exhibits during commit/rollback with JdbcXyzCacheStore, but it is rather a more general cache store issue.
When using a TransactionManager, during TM.commit AbstractCacheStore.commit is being called internally which tries to apply all the modifications that happened during that transaction.
Within the scope of AbstractCacheStore.commit, JdbcStore obtains a connection from a DataSource and tries to write the modifications on that connection.
Now if the DataSource is managed (e.g. by an A.S.) on the DS.getConnection call the A.S. would try to enlist the connection with the ongoing transaction by calling Transaction.enlistResource(XAResource xaRes) [1]
This method fails with an IllegalStateException, because the transaction's status is preparing (see javax.transaction.Transaction.enlistResource).
Suggested fix:
- the modifications should be registered to the transaction as they happen(vs. during prepare/commit as it happens now)
- this requires API changes in CacheStore, e.g.
void store(InternalCacheEntry entry)
should become
void store(InternalCacheEntry entry, GlobalTransaction gtx)
(gtx would be null if this is not a transactional call).
[1] This behavior is specified by the JDBC 2.0 Standard Extension API, chapter 7 - distributed transaction
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] (ISPN-2033) JdbcBinaryCacheStore.purgeInternal() - releaseConnection() should be called in finally block.
by Jim Dunkerton (JIRA)
Jim Dunkerton created ISPN-2033:
-----------------------------------
Summary: JdbcBinaryCacheStore.purgeInternal() - releaseConnection() should be called in finally block.
Key: ISPN-2033
URL: https://issues.jboss.org/browse/ISPN-2033
Project: Infinispan
Issue Type: Bug
Components: Loaders and Stores
Affects Versions: 5.1.2.FINAL
Environment: JBoss 7.1.1 Final
Reporter: Jim Dunkerton
Assignee: Manik Surtani
A potential memory leak of pooled DB connections is present in JdbcCacheBinaryStore. Observe the catch and finally blocks of the purgeInternal() method:
catch (SQLException ex) {
//if something happens make sure buckets locks are being release
releaseLocks(expiredBuckets);
connectionFactory.releaseConnection(conn);
log.failedClearingJdbcCacheStore(ex);
throw new CacheLoaderException("Failed clearing JdbcBinaryCacheStore", ex);
} finally {
JdbcUtil.safeClose(ps);
JdbcUtil.safeClose(rs);
}
The pooled DB connection is not released unless an SQLException has been thrown.
Contrast with JdbcStringBasedCacheStore.purgeInternal():
} catch (SQLException ex) {
log.failedClearingJdbcCacheStore(ex);
throw new CacheLoaderException("Failed clearing string based JDBC store", ex);
} finally {
JdbcUtil.safeClose(ps);
connectionFactory.releaseConnection(conn);
}
When using a JdbcMixedCacheStore, I noticed a DB connection leak. It appeared that for every two connections being acquired, only one was being released. I believe it is down to the fact that the JdbcBinaryCacheStore inside the JdbcMixedCacheStore is not releasing its connections properly (i.e. in its finally block) whereas the JdbcStringBasedCacheStore is.
I guess a workaround is to use only a JdbcStringBasedCacheStore, not a JdbcMixedCacheStore.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (ISPN-1103) Soft schema-based storage
by Manik Surtani (JIRA)
Soft schema-based storage
-------------------------
Key: ISPN-1103
URL: https://issues.jboss.org/browse/ISPN-1103
Project: Infinispan
Issue Type: Feature Request
Components: Core API
Reporter: Manik Surtani
Assignee: Manik Surtani
Fix For: 5.1.0.BETA1, 5.1.0.Final
This JIRA is about storing metadata alongside values. Perhaps encapsulating values as SchematicValues, which could be described as:
{code}
class SchematicValue {
String jsonMetadata;
String jsonObject;
}
{code}
Metadata would allow for a few interesting features:
* Extracting of lifespan and timestamp data if manipulated over a remote protocol (REST, HotRod, etc)
* Content type for REST responses
* Timestamps for REST headers, will affect HTTP content caches
* Validation information (may not be processed by Infinispan, but can be used by client libs)
* Classloader/marshaller/classdef version info
* General structure of the information stored
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months