[
https://jira.jboss.org/jira/browse/JBSEAM-4528?page=com.atlassian.jira.pl...
]
deanhiller commented on JBSEAM-4528:
------------------------------------
Well, a proxy didn't work either. Unfortunately jboss/seam/hibernate is calling
getTransactionIsolation forcing my proxy to then call getConnection so I can call that
method on the real datasource connection....UGH. Jboss/seam/hibernate should really not
call getTransactionIsolation unless I REALLY do some sql or some operations with the
database(kind of like the postgres jdbc driver handles it).
2010-02-01 13:48:36,331 ERROR [org.hibernate.util.JDBCExceptionReporter]
(http-127.0.0.1-8080-1) [player][session:49E9CB]Unable to get managed connection for
OracleDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed
connection for OracleDS)
2010-02-01 13:48:36,331 ERROR [org.jboss.seam.exception.Exceptions]
(http-127.0.0.1-8080-1) [player][session:49E9CB]handled and logged exception
java.lang.IllegalStateException: Could not start transaction
at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:598)
at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:583)
at
org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:327)
at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:144)
at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:63)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at net.voicelog.web.http.FilterForLogging.doFilter(FilterForLogging.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at
org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn.invoke(ClusteredSingleSignOn.java:672)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: Cannot open connection
at
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:41)
at org.jboss.seam.transaction.EntityTransaction.begin(EntityTransaction.java:82)
at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:593)
... 54 more
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1353)
at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:38)
... 56 more
Caused by: org.jboss.util.NestedSQLException: Unable to get managed connection for
OracleDS; - nested throwable: (javax.resource.ResourceException: Unable to get managed
connection for OracleDS)
at
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:95)
at
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:46)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
... 61 more
Caused by: javax.resource.ResourceException: Unable to get managed connection for
OracleDS
at
org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:441)
at
org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)
at
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
at
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
at
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
... 63 more
Caused by: org.jboss.resource.JBossResourceException: Could not create connection; -
nested throwable: (java.lang.RuntimeException: exception1)
at
org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:465)
at
org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:409)
at
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:633)
at
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)
at
org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)
at
org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)
... 67 more
Caused by: java.lang.RuntimeException: exception1
at
net.voicelog.oracleworkaround.XACachingConnection.getCachedConnection(XACachingConnection.java:43)
at
net.voicelog.oracleworkaround.XACachingConnection.getRealConnection(XACachingConnection.java:78)
at
net.voicelog.oracleworkaround.CachingConnection.getConnection(CachingConnection.java:78)
at
net.voicelog.oracleworkaround.CachingConnection.getTransactionIsolation(CachingConnection.java:185)
at
org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.<init>(BaseWrapperManagedConnection.java:143)
at
org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.<init>(XAManagedConnection.java:56)
at
org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.newXAManagedConnection(XAManagedConnectionFactory.java:475)
at
org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:453)
... 72 more
Caused by: java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:480)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:413)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
at oracle.jdbc.pool.OracleDataSource.getPhysicalConnection(OracleDataSource.java:275)
at
oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:454)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:159)
at oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:130)
at net.sf.log4jdbc.DataSourceSpy.getXAConnection(DataSourceSpy.java:167)
at
net.voicelog.oracleworkaround.XACachingConnection.getCachedConnection(XACachingConnection.java:39)
... 79 more
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the
connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:328)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:421)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:630)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:206)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:966)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:292)
... 89 more
Caused by: java.net.SocketException: Network is unreachable
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:120)
at oracle.net.nt.ConnOption.connect(ConnOption.java:126)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:306)
... 94 more
static pages don't work at all with database down and XA
datasource used
------------------------------------------------------------------------
Key: JBSEAM-4528
URL:
https://jira.jboss.org/jira/browse/JBSEAM-4528
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.2.0.GA
Environment: postgres or oracle with postgres or oracle XADatasource. postgres
jdbc driver is fine while oracle driver is not
Reporter: deanhiller
Priority: Critical
Attachments: oracleBAD.log, postgres.log
If this is a hibernate bug, please report hibernate issue and ticket here as other seam
users will run into this problem and it looks like a seam framework problem(or at least
could be solved in seam but it may be possible to solve in hibernate too and could be
solved in each and every driver datasource as well).
Steps to reproduce
1. start up the jboss 5.1.0 with latest seam
2. pull your internet connection so the db is gone
3. have all your customers go to a static page like /web/error.xhtml
RESULT: jboss goes to it's knees as users in IE end up in infinite redirects to your
server causing more and more load on the server. The drivers talk to the database when
they should not be. I have a work around proxy driver for oracle's jdbc driver. I do
not however have a fix for oracle's datasource or postgres datasource.
I imagine someone could write a proxy datasource that would solve this problem for all
people, hibernate, seam and all xa drivers. I will attach logs of postgres xa driver and
oracle one but basically they are trying to open a connection to database when ANY http
request comes in until waiting to see if we actually do any select statements or updates
or inserts. For some reason, the postgres driver and oracle driver where fine here...they
did not make db requests when an http request came in. The oracle driver however did make
a request to the db when commit is called even if no sql was done against the db where
postgres driver ignored the commit since no sql was done. I will try to attach files or
more comments here. PLEASE if you report a tic in hibernate put it in here for others to
find when they hit this issue.
keyphrases:
seam doesn't work when database goes down
seam infinite redirect on db outage
database failure causes seam to not work
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira