[JBoss Cache: Core Edition] - Re: TcpDelegatingCacheLoader
by lovelyliatroim
"lovelyliatroim" wrote : anonymous wrote :
| | No reason, really. Happy to accept a patch, to make this configurable using a cache loader property.
| |
|
| Created one for the 2.2.1.GA version
| https://jira.jboss.org/jira/browse/JBCACHE-1451
|
Hi Manik,
You might have to revert that patch or take a new one.
Here is the problem.
| protected transient Object invokeWithRetries(Method m, Object params[])
| {
| long endTime = System.currentTimeMillis() + (long)config.getTimeout();
| _L2:
| return m.invoke(this, params);
| IllegalAccessException e;
| e;
| log.error("Should never get here!", e);
| continue; /* Loop/switch isn't completed */
| e;
| if(e.getCause() instanceof IOException)
| {
| try
| {
| if(log.isDebugEnabled())
| {
| log.debug("Caught IOException. Retrying.", e);
| }
| Thread.sleep(config.getReconnectWaitTime());
| restart();
| }
| catch(IOException e1) { }
| catch(InterruptedException e1) { }
| } else
| {
| throw new CacheException("Problems invoking method call!", e);
| }
| if(System.currentTimeMillis() < endTime) goto _L2; else goto _L1
| _L1:
| throw new CacheException((new StringBuilder()).append("Unable to communicate with TCPCacheServer(").append(config.getHost()).append(":").append(config.getPort()).append(") after ").append(config.getTimeout()).append(" millis, with reconnects every ").append(config.getReconnectWaitTime()).append(" millis.").toString());
| }
|
Problem is this, if we have a timeout,which the patch allows you to do, it throws an IOExcpeption. When we get an IOEXception we will call "restart" which tears down and up the socket even though its not needed. We shouldnt be tearing up and down the socket if we timeout.
2nd problem it is not thread safe. Multiple threads can call restart if we timeout.
So you either revert it or take a 2nd patch. I have already adopted my version so patch is available if needed.
Just so you know about it.
Cheers,
LL
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200925#4200925
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200925
17 years, 6 months
[JBoss jBPM] - Re: Hibernate and log4j
by glnd
Thanks a lot kukeltje, indeed i missed the fact that the parameters where commented out.
But that only solved my problem partially.
So also thanks to mputz. The replacement of the commons-logging.jar solved the rest of the problem!
I also changed the jboss-log4j.xml a little bit so that all sql is logged into a separate file. (Based on this article: http://hibernar.org/articulos_en/logging.php)
This is how my jboss-log4j.xml looks now:
<?xml version="1.0" encoding="UTF-8" ?>
| <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
| <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
| <appender name="appenderConsole" class="org.apache.log4j.ConsoleAppender">
| <layout class="org.apache.log4j.SimpleLayout"/>
| </appender>
|
| <appender name="appenderNormalFile" class="org.apache.log4j.RollingFileAppender">
| <param name="File" value="${jboss.server.log.dir}/normal.log"/>
| <param name="Append" value="true"/>
| <param name="MaxFileSize" value="500KB"/>
| <param name="MaxBackupIndex" value="1"/>
| <layout class="org.apache.log4j.PatternLayout">
| <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
| </layout>
| </appender>
|
| <appender name="appenderSQLFile" class="org.apache.log4j.RollingFileAppender">
| <param name="File" value="${jboss.server.log.dir}/sql.log"/>
| <param name="Append" value="true"/>
| <param name="MaxFileSize" value="500KB"/>
| <param name="MaxBackupIndex" value="1"/>
| <layout class="org.apache.log4j.PatternLayout">
| <param name="ConversionPattern" value="%d %m%n"/>
| </layout>
| </appender>
|
| <category name="org.hibernate.SQL" additivity="false">
| <priority value="debug" />
| <appender-ref ref="appenderConsole" />
| <appender-ref ref="appenderSQLFile" />
| </category>
|
| <category name="org.hibernate.type" additivity="false">
| <priority value="debug" />
| <appender-ref ref="appenderConsole" />
| <appender-ref ref="appenderSQLFile" />
| </category>
|
| <root>
| <priority value="info" />
| <appender-ref ref="appenderConsole" />
| <appender-ref ref="appenderNormalFile" />
| </root>
|
| </log4j:configuration>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200923#4200923
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200923
17 years, 6 months