[JBossCache] - JDBCCacheLoader error: Io exception: The Network Adapter cou
by gmeroz
if i use the following code with a JDBCCacheLoader, i get the following exception after a while (after putting about 250 items to the cache):
| for (int i=0 ; i<10000 ;i++){
| Person x = new Person();
| x.setName("x"+i);
| x.setAddress(address);
| cache.put("engine/x"+i,x);
| }
|
| 12:19:32,645 ERROR [JDBCCacheLoader] Failed to get connection for url=jdbc:oracle:thin:@dbms01:1521:besapp, user=GILEADHBVMC02_NEW2, password=GILEADHBVMC02_NEW2
| java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
| at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:274)
| at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:328)
| at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:348)
| at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)
| at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
| at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:563)
| at java.sql.DriverManager.getConnection(DriverManager.java:525)
| at java.sql.DriverManager.getConnection(DriverManager.java:171)
| at org.jboss.cache.loader.JDBCCacheLoader$NonManagedConnectionFactory.getConnection(JDBCCacheLoader.java:1157)
| at org.jboss.cache.loader.JDBCCacheLoader.loadNode(JDBCCacheLoader.java:816)
| at org.jboss.cache.loader.JDBCCacheLoader.get(JDBCCacheLoader.java:202)
| at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadData(CacheLoaderInterceptor.java:533)
| at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadNode(CacheLoaderInterceptor.java:426)
| at org.jboss.cache.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:214)
| at org.jboss.cache.interceptors.CacheLoaderInterceptor.invoke(CacheLoaderInterceptor.java:185)
| at org.jboss.cache.interceptors.ActivationInterceptor.invoke(ActivationInterceptor.java:66)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
| at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:33)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
| at org.jboss.cache.interceptors.PassivationInterceptor.invoke(PassivationInterceptor.java:80)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
| at org.jboss.cache.interceptors.NotificationInterceptor.invoke(NotificationInterceptor.java:22)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
| at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:288)
| at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:126)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
| at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:126)
| at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:75)
| at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:66)
| at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:3750)
| at org.jboss.cache.CacheImpl.get(CacheImpl.java:1390)
| at org.jboss.cache.CacheImpl.get(CacheImpl.java:1365)
| at org.jboss.cache.pojo.impl.InternalHelper.get(InternalHelper.java:142)
| at org.jboss.cache.pojo.impl.InternalHelper.getAopInstance(InternalHelper.java:72)
| at org.jboss.cache.pojo.impl.InternalHelper.getPojo(InternalHelper.java:264)
| at org.jboss.cache.pojo.impl.PojoCacheDelegate.getObject(PojoCacheDelegate.java:88)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.getObject(PojoCacheImpl.java:208)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$find$aop(PojoCacheImpl.java:196)
| at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.find_N_7063709169143275953(PojoCacheImpl$PojoCacheImplAdvisor.java)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.find(PojoCacheImpl.java)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$detach$aop(PojoCacheImpl.java:160)
| at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.detach9209594694587929181(PojoCacheImpl$PojoCacheImplAdvisor.java)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.detach(PojoCacheImpl.java)
| at org.jboss.cache.pojo.impl.PojoCacheDelegate.putObjectII(PojoCacheDelegate.java:150)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.putObject(PojoCacheImpl.java:145)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$attach$aop(PojoCacheImpl.java:122)
| at org.jboss.cache.pojo.impl.PojoCacheImpl$PojoCacheImplAdvisor.attach3085019539260813833(PojoCacheImpl$PojoCacheImplAdvisor.java)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java)
| at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:114)
| at com.bevents.infra.service.cache.JBossCacheImpl.put(JBossCacheImpl.java:41)
| at com.bevents.infra.service.cache.JBossCacheImplTest.testPutAndGet(JBossCacheImplTest.java:47)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at junit.framework.TestCase.runTest(TestCase.java:154)
| at junit.framework.TestCase.runBare(TestCase.java:127)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at junit.textui.TestRunner.doRun(TestRunner.java:116)
| at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:69)
| at junit.textui.TestRunner.doRun(TestRunner.java:109)
| at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
| at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
| at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
| 12:19:32,723 INFO [TxInterceptor] There was a problem handling this request
|
The cache configuration::
| <mbean code="org.jboss.cache.TreeCache"
| name="jboss.cache:service=TreeCache">
|
| <depends>jboss:service=Naming</depends>
| <depends>jboss:service=TransactionManager</depends>
|
| <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
| <attribute name="IsolationLevel">READ_COMMITTED</attribute>
|
| <attribute name="CacheMode">LOCAL</attribute>
| <attribute name="CacheLoaderConfiguration">
| <config>
| <passivation>false</passivation>
| <preload>/</preload>
| <shared>true</shared>
|
| <cacheloader>
| <class>org.jboss.cache.loader.JDBCCacheLoader</class>
| <properties>
| cache.jdbc.table.name=jbosscache_test
| cache.jdbc.table.create=true
| cache.jdbc.table.drop=true
| cache.jdbc.table.primarykey=jbosscache_test_pk
| cache.jdbc.fqn.column=fqn
| cache.jdbc.fqn.type=varchar(255)
| cache.jdbc.node.column=node
| cache.jdbc.node.type=blob
| cache.jdbc.parent.column=parent
| cache.jdbc.driver=oracle.jdbc.driver.OracleDriver
| cache.jdbc.url=jdbc:oracle:thin:@dbms01:1521:besapp
| cache.jdbc.user=GILEADHBVMC02_NEW2
| cache.jdbc.password=GILEADHBVMC02_NEW2
| </properties>
|
| <!-- whether the cache loader writes are asynchronous -->
| <async>false</async>
| <!-- only one cache loader in the chain may set fetchPersistentState to true.-->
| <!--An exception is thrown if more than one cache loader sets this to true. -->
| <fetchPersistentState>false</fetchPersistentState>
| <!-- determines whether this cache loader ignores writes - defaults to false. -->
| <ignoreModifications>false</ignoreModifications>
| <!-- if set to true, purges the contents of this cache loader when the cache starts up.-->
| <!--Defaults to false. -->
| <purgeOnStartup>false</purgeOnStartup>
| </cacheloader>
| </config>
| </attribute>
| </mbean>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008209#4008209
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008209
19 years, 2 months
[JBoss Seam] - Question about request/response lifecycle
by buddy1974
Hi All,
I have stumbled upon this article: http://today.java.net/pub/a/today/2006/02/09/file-uploads-with-ajax-and-j... and I am trying to get this work with seam. The ProgressBar Component does not work. I think I know why, but I am not sure.
I noticed that the Author wrote inside his FileUploadRenderer Component
if(parameterMap.containsKey(PROGRESS_REQUEST_PARAM_NAME))
| {
| // This is a request to get the progress on the file request.
| // Get the progress and render it as XML
|
| HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
|
| // set the header information for the response
| response.setContentType("text/xml");
| response.setHeader("Cache-Control", "no-cache");
|
| try
| {
| ResponseWriter writer = FacesUtils.setupResponseWriter(context);
| writer.startElement("progress", input);
| writer.startElement("percentage", input);
| // writer.writeText(result, null);
| // Get the current progress percentage from the session (as set
| // by the filter).
| Double progressCount = (Double) extContext.getSessionMap().get(
| "FileUpload.Progress." + input.getClientId(context));
|
| if(progressCount != null)
| {
| writer.writeText(progressCount, null);
| }
| else
| {
| // We havn't received the upload yet.
| writer.writeText("1", null);
| }
|
| writer.endElement("percentage");
| writer.startElement("clientId", input);
| writer.writeText(input.getClientId(context), null);
| writer.endElement("clientId");
| writer.endElement("progress");
|
| }
| catch (Exception e)
| {
| // Do some sot of error logging...
| throw new RuntimeException(e);
| }
|
| }
| else
| {
| // Normal decoding request.
| if(requestMap.get(clientId).toString().equals("file"))
| {
| try
| {
| HttpServletRequest request = (HttpServletRequest) extContext.getRequest();
| FileItem fileData = (FileItem) request.getAttribute(clientId);
| if(fileData != null)
| input.setSubmittedValue(fileData);
|
| // Now we need to clear any progress associated with this
| // item.
| extContext.getSessionMap()
| .put("FileUpload.Progress." + input.getClientId(context), new Double(100));
|
| }
| catch (Exception e)
| {
| throw new RuntimeException(
| "Could not handle file upload - please ensure that you have correctly configured the filter.",
| e);
| }
| }
| }
| }
|
It seems as if the author is trying to itercept the response sent back to the client, by sending a response.setContentType("text/xml");. Is this really possible?
I rather think, that this has to go inside a PhaseListener, and output the XML from there, or am I wrong?
Any Help is highly appreciated
Kind regards
Juergen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008202#4008202
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008202
19 years, 2 months
[JBoss Seam] - Re: Seam + EJB3 performance
by vladimir.kovalyuk
Christian, thanks a lot for hints. It's interesting topic.
Being impressed by long SQL statements generated by Hibernate and understanding that most of them are not required I decided that I need to try an idea of SFSB as backing bean. I annotated all the relations among entities as fetch=lazy. So all the requests that are generated during page rendering are single select without joins. Tree-related requests are generated only when expanding a node. Thus I don't think that Hibernate or DB is the cause.
Norman, I'm afraid I need to measure whole project. I realized that there is other potential causes of performance loss. For instance it seems that facelets always compiles inclusions and source components in debug mode. Please take my apologies for not being well-prepared when raising this question.
I understand that Seam and EJB3 requires some reasonable overhead. But from my point of view a hundred lines of stack traces doesn't seem reasonable. I understand that interceptors can be less time consumptive in comparison with the others sources of overhead. I believe this is a question of reasonable trade-off.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008199#4008199
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008199
19 years, 2 months