[JBossCache] - optimistic cache locking
by edavis
Hi, im using jboss4.0.5.GA and if im not wrong it has hibernate 3.2 wich has optimistic cache locking, how do I enable it?
For example my ejb3-cache-service.xml is
| <?xml version="1.0" encoding="UTF-8"?>
| <server>
| <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=EJB3EntityTreeCache">
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
| <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
| <attribute name="CacheMode">REPL_SYNC</attribute>
| <attribute name="ClusterName">EJB3-entity-cache</attribute>
| <attribute name="ClusterConfig">
| <config>
| <UDP mcast_addr="${jboss.partition.udpGroup:228.1.2.3}" mcast_port="43333" ip_ttl="${jgroups.mcast.ip_ttl:2}" ip_mcast="true"
| mcast_send_buf_size="150000" mcast_recv_buf_size="80000" ucast_send_buf_size="150000"
| ucast_recv_buf_size="80000" loopback="false" />
| <PING timeout="2000" num_initial_members="3" up_thread="false" down_thread="false" />
| <MERGE2 min_interval="10000" max_interval="20000" />
| <FD_SOCK down_thread="false" up_thread="false"/>
| <FD shun="true" up_thread="false" down_thread="false"
| timeout="20000" max_tries="5"/>
| <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false" />
| <pbcast.NAKACK gc_lag="50" max_xmit_size="8192" retransmit_timeout="600,1200,2400,4800" up_thread="false"
| down_thread="false" />
| <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10" down_thread="false" />
| <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false" />
| <FRAG frag_size="8192" down_thread="false" up_thread="false" />
| <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true" />
| <pbcast.STATE_TRANSFER up_thread="false" down_thread="false" />
| </config>
| </attribute>
| <attribute name="InitialStateRetrievalTimeout">5000</attribute>
| <attribute name="SyncReplTimeout">10000</attribute>
| <attribute name="LockAcquisitionTimeout">15000</attribute>
| <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
| <attribute name="EvictionPolicyConfig">
| <config>
| <attribute name="wakeUpIntervalSeconds">5</attribute>
| <region name="/_default_">
| <attribute name="maxNodes">5000</attribute>
| <attribute name="timeToLiveSeconds">1000</attribute>
| </region>
| </config>
| </attribute>
| </mbean>
| </server>
|
Which is using pessimistic cache locking, whats the parameter to change? ive searched lots of manuals and configuration tutorial but no luck so far.
Also, if I change it to optimistic, do I need to do anything else in the code? do I need to perform evictions by hand?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009390#4009390
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009390
18Â years, 9Â months
[EJB 3.0] - trying to get the language from de jndi context in EJB3SLSB
by putopuntocom
I'm creating a context for accessing a Stateless EJB3.
String JNDI_FACTORY = "org.jboss.security.jndi.JndiLoginInitialContextFactory";
| String JNDI_PROVIDER_URL = "jnp://localhost";
| String JNDI_PROVIDER_PORT = "1099";
|
| Properties prop = new Properties();
| prop.put( Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY );
| prop.put( Context.PROVIDER_URL, JNDI_PROVIDER_URL + ":"
| + JNDI_PROVIDER_PORT );
|
| prop.put( Context.LANGUAGE, "ca");
| prop.put( Context.SECURITY_PRINCIPAL, "test1");
| prop.put( Context.SECURITY_CREDENTIALS, "test1");
|
|
| InitialContext ctx = new InitialContext(prop);
Then I make the lookup and everythings works ok.
The quiz is:
How can I access to the Context.LANGUAGE from EJB3?.
I've tried:
- new InitialContext().getEnvironment()
| - new InitialContext().lookup(Context.LANGUAGE)
And this property doesn't exist.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009377#4009377
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009377
18Â years, 9Â months