HHH-7947 remove not maintained 2LC from doc

This commit is contained in:
Strong Liu 2013-01-28 13:29:12 +08:00
parent ae3555221c
commit 2a68f8bef0
8 changed files with 35 additions and 64 deletions

View File

@ -383,42 +383,12 @@
<listitem><para>read-only</para></listitem>
<listitem><para>nontrict read-write</para></listitem>
<listitem><para>read-write</para></listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>OSCache</entry>
<entry></entry>
<entry>
<itemizedlist>
<listitem><para>read-only</para></listitem>
<listitem><para>nontrict read-write</para></listitem>
<listitem><para>read-write</para></listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>SwarmCache</entry>
<entry></entry>
<entry>
<itemizedlist>
<listitem><para>read-only</para></listitem>
<listitem><para>nontrict read-write</para></listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>JBoss Cache 1.x</entry>
<entry></entry>
<entry>
<itemizedlist>
<listitem><para>read-only</para></listitem>
<listitem><para>transactional</para></listitem>
</itemizedlist>
</entry>
</row>
<row>
<entry>JBoss Cache 2.x</entry>
<entry>Infinispan</entry>
<entry></entry>
<entry>
<itemizedlist>

View File

@ -226,7 +226,7 @@ session.close();]]></programlisting>
<para>
In keeping with the EJB3 specification, HQL <literal>UPDATE</literal> statements, by default, do not effect the
<xref linkend="mapping-declaration-version">version</xref>
<xref linkend="entity-mapping-entity-version">version</xref>
or the <xref linkend="mapping-declaration-timestamp">timestamp</xref> property values
for the affected entities. However,
you can force Hibernate to reset the <literal>version</literal> or

View File

@ -194,7 +194,7 @@ public class PutFromLoadValidator {
// or regionRemoved has been called. Check if we can proceed
if (now > invalidationTimestamp) {
Long removedTime = recentRemovals.get(key);
if (removedTime == null || now > removedTime.longValue()) {
if (removedTime == null || now > removedTime ) {
// It's legal to proceed. But we have to record this key
// in pendingPuts so releasePutFromLoadLock can find it.
// To do this we basically simulate a normal "register
@ -280,7 +280,7 @@ public class PutFromLoadValidator {
// Don't let recentRemovals map become a memory leak
RecentRemoval toClean = null;
boolean attemptClean = removal.timestamp.longValue() > earliestRemovalTimestamp;
boolean attemptClean = removal.timestamp > earliestRemovalTimestamp;
removalsLock.lock();
try {
removalsQueue.add(removal);
@ -290,7 +290,7 @@ public class PutFromLoadValidator {
// just added it
toClean = removalsQueue.remove(0);
}
earliestRemovalTimestamp = removalsQueue.get(0).timestamp.longValue();
earliestRemovalTimestamp = removalsQueue.get( 0 ).timestamp;
}
} finally {
removalsLock.unlock();
@ -526,7 +526,7 @@ public class PutFromLoadValidator {
private RecentRemoval(Object key, long nakedPutInvalidationPeriod) {
this.key = key;
timestamp = Long.valueOf(System.currentTimeMillis() + nakedPutInvalidationPeriod);
timestamp = System.currentTimeMillis() + nakedPutInvalidationPeriod;
}
}

View File

@ -8,6 +8,7 @@ import org.hibernate.cache.spi.EntityRegion;
import org.hibernate.cache.spi.RegionFactory;
import org.hibernate.cache.spi.access.AccessType;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.infinispan.AdvancedCache;
/**
@ -17,22 +18,25 @@ import org.infinispan.AdvancedCache;
*/
public class EntityRegionImpl extends BaseTransactionalDataRegion implements EntityRegion {
public EntityRegionImpl(AdvancedCache cache, String name,
CacheDataDescription metadata, RegionFactory factory) {
super(cache, name, metadata, factory);
}
public EntityRegionImpl(AdvancedCache cache, String name,
CacheDataDescription metadata, RegionFactory factory) {
super( cache, name, metadata, factory );
}
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
if (AccessType.READ_ONLY.equals(accessType)) {
return new ReadOnlyAccess(this);
} else if (AccessType.TRANSACTIONAL.equals(accessType)) {
return new TransactionalAccess(this);
}
throw new CacheException("Unsupported access type [" + accessType.getExternalName() + "]");
}
@Override
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
switch ( accessType ) {
case READ_ONLY:
return new ReadOnlyAccess( this );
case TRANSACTIONAL:
return new TransactionalAccess( this );
default:
throw new CacheException( "Unsupported access type [" + accessType.getExternalName() + "]" );
}
}
public PutFromLoadValidator getPutFromLoadValidator() {
return new PutFromLoadValidator(cache);
}
public PutFromLoadValidator getPutFromLoadValidator() {
return new PutFromLoadValidator( cache );
}
}

View File

@ -23,6 +23,7 @@ public abstract class BaseTransactionalDataRegion
this.metadata = metadata;
}
@Override
public CacheDataDescription getCacheDataDescription() {
return metadata;
}

View File

@ -26,12 +26,14 @@ public class NaturalIdRegionImpl extends BaseTransactionalDataRegion
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
if (AccessType.READ_ONLY.equals(accessType)) {
return new ReadOnlyAccess(this);
} else if (AccessType.TRANSACTIONAL.equals(accessType)) {
return new TransactionalAccess(this);
switch ( accessType ){
case READ_ONLY:
return new ReadOnlyAccess( this );
case TRANSACTIONAL:
return new TransactionalAccess( this );
default:
throw new CacheException( "Unsupported access type [" + accessType.getExternalName() + "]" );
}
throw new CacheException("Unsupported access type [" + accessType.getExternalName() + "]");
}
public PutFromLoadValidator getPutFromLoadValidator() {

View File

@ -10,7 +10,6 @@ import org.hibernate.cache.spi.access.SoftLock;
* @author Strong Liu <stliu@hibernate.org>
*/
class ReadOnlyAccess extends TransactionalAccess {
private static final Log log = LogFactory.getLog( ReadOnlyAccess.class );
ReadOnlyAccess(NaturalIdRegionImpl naturalIdRegion) {
super( naturalIdRegion );

View File

@ -37,14 +37,9 @@ public class HibernateTransactionManagerLookup implements org.infinispan.transac
private final JtaPlatform jtaPlatform;
public HibernateTransactionManagerLookup(Settings settings, Properties properties) {
if ( settings != null ) {
jtaPlatform = settings.getJtaPlatform();
}
else {
jtaPlatform = null;
}
this.jtaPlatform = settings != null ? settings.getJtaPlatform() : null;
}
@Override
public TransactionManager getTransactionManager() throws Exception {
return jtaPlatform == null ? null : jtaPlatform.retrieveTransactionManager();
}