Transactions Infinispan保存到Weblogic server中的缓存
以下是我的设置详细信息: 应用服务器:Weblogic 10.3 Infinispan版本:5.3.0.Final 模式:库模式 操作系统:Linux 服务器设置:高可用性 自从我们从JBoss缓存迁移以来,我一直在使用TreeCacheAPI 我看到的是,当我在普通的linux或windows机器上运行代码时。put和get API工作正常 但当我对Weblogic服务器运行代码时,put从未成功过,表示事务失败。XA事务。注意,当我不使用事务时会发生这种情况 我通过在xml配置文件中声明事务实现了这一点,如下所示:Transactions Infinispan保存到Weblogic server中的缓存,transactions,infinispan,Transactions,Infinispan,以下是我的设置详细信息: 应用服务器:Weblogic 10.3 Infinispan版本:5.3.0.Final 模式:库模式 操作系统:Linux 服务器设置:高可用性 自从我们从JBoss缓存迁移以来,我一直在使用TreeCacheAPI 我看到的是,当我在普通的linux或windows机器上运行代码时。put和get API工作正常 但当我对Weblogic服务器运行代码时,put从未成功过,表示事务失败。XA事务。注意,当我不使用事务时会发生这种情况 我通过在xml配置文件中声明事务
<transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
lockingMode="OPTIMISTIC"
transactionMode="TRANSACTIONAL"
/>
然后使用
utx.begin();
get node by fqn;
node.put(key,value);
utx.commit();
只有在使用引号进行上述操作之后,我才能在缓存中看到一个条目并成功地检索它
我想知道为什么会这样?我可以不使用事务吗
以下是xml配置文件:
<global>
<globalJmxStatistics enabled = "true" />
<transport clusterName = "CACHE_CLUSTER">
<properties>
<property name="configurationFile"
value="tcp.xml" />
</properties>
</transport>
</global>
<default>
<clustering mode="replication">
<async asyncMarshalling="true" useReplQueue="true" replQueueInterval="10" replQueueMaxElements="100" />
<stateTransfer timeout="2000000"/>
</clustering>
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
lockingMode="OPTIMISTIC"
transactionMode="TRANSACTIONAL"
/>
<invocationBatching enabled = "true"/>
<jmxStatistics enabled="true"/>
</default>
我强烈建议您移动树API,并使用普通映射API,它使用起来更简单,可以与事务一起使用,也可以不与事务一起使用。树API确实需要批处理,这将强制启用事务。感谢您的回复。我选择了TreCache,因为我们正在从JBaseCache中迁移,预期的变化很小。但是我会认真考虑切换到MAPAPI的这个选项。我之前就试过了,效果很好。即使单独使用批处理也不能解决这个问题。为此,我已经发布了感谢您的回复高尔德。我继续在同一个论坛上发表文章,因为文章描述的工作方式与我在Weblogic两节点高可用性服务器上的工作方式相同。但当我对独立weblogic服务器使用相同的代码时。transaction.commit抛出错误,表示事务不存在。。如果这是Infinispan或Weblogic服务器的事务处理问题,我想找到根目录。
<global>
<globalJmxStatistics enabled = "true" />
<transport clusterName = "CACHE_CLUSTER">
<properties>
<property name="configurationFile"
value="tcp.xml" />
</properties>
</transport>
</global>
<default>
<clustering mode="replication">
<async asyncMarshalling="true" useReplQueue="true" replQueueInterval="10" replQueueMaxElements="100" />
<stateTransfer timeout="2000000"/>
</clustering>
<transaction
transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
lockingMode="OPTIMISTIC"
transactionMode="TRANSACTIONAL"
/>
<invocationBatching enabled = "true"/>
<jmxStatistics enabled="true"/>
</default>