You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Jason Harrop <ja...@xn.com.au> on 2002/01/17 02:28:57 UTC
[Patch] Re: cvs commit: jakarta-slide/src/stores/slidestore/reference JDBCDescriptorsStore.java JDBCContentStore.java
Hi, as you might have suspected, all that seems to be required to fix
this is to close the statement that we use to check the connection
A similar change is required in JDBCContentStore.
cheers,
Jason
Index: JDBCDescriptorsStore.java
===================================================================
RCS file:
/home/cvspublic/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v
retrieving revision 1.29
diff -r1.29 JDBCDescriptorsStore.java
511c511
<
---
> statement.close();
1784c1784
< }
\ No newline at end of file
---
> }
Jason Harrop wrote:
> Hello Dirk
>
> With Slide built today to test this patch, Oracle now throws:
>
> org.apache.slide.common.ServiceAccessException: Service
> slidestore.reference.JDBCDescriptorsStore@362012 access error :
> ORA-01000: maximum open cursors exceeded
>
> at
> slidestore.reference.JDBCDescriptorsStore.isConnected(JDBCDescriptorsStore.java:516)
>
> at
> org.apache.slide.store.AbstractStore.isConnected(AbstractStore.java:300)
> at
> org.apache.slide.common.AbstractServiceBase.connectIfNeeded(AbstractServiceBase.java:209)
>
> at org.apache.slide.common.Uri.reconnectServices(Uri.java:262)
> at org.apache.slide.common.Namespace.getUri(Namespace.java:675)
> at org.apache.slide.common.Namespace.getUri(Namespace.java:647)
> at org.apache.slide.common.Namespace.getUri(Namespace.java:635)
> at
> org.apache.slide.security.SecurityImpl.hasPermission(SecurityImpl.java:438)
> at
> org.apache.slide.security.SecurityImpl.checkPermission(SecurityImpl.java:407)
>
> at
> org.apache.slide.security.SecurityImpl.checkCredentials(SecurityImpl.java:379)
>
> at
> org.apache.slide.structure.StructureImpl.retrieve(StructureImpl.java:187)
> at org.apache.slide.content.ContentImpl.retrieve(ContentImpl.java:325)
> at org.apache.slide.content.ContentImpl.retrieve(ContentImpl.java:305)
>
> .. or from somewhere else in ContentImpl.
>
> Please not, this happens while Slide is being started (or if not then,
> then after one or two propfinds), without me doing anything to kill the
> database connection.
>
> Also, this is with the JDBCDescriptorsStore and FileCOntentStore - i've
> never had the open cursors problem with the JDBCDescriptorsStore before.
>
> The goods news is that if i do shutdown Oracle and start it up again, it
> does as least reconnect because of the new code in transaction start
> (and the fact that even the read-only webdav methods use transactions :) ).
>
> thanks,
>
> Jason
>
>
> dirkv@apache.org wrote:
>
>> dirkv 02/01/12 08:04:26
>>
>> Modified: src/stores/slidestore/reference JDBCDescriptorsStore.java
>> JDBCContentStore.java
>> Log:
>> - reconnect when connection is lost
>> - isConnected includes test with sql statement
>> Revision Changes Path
>> 1.29 +57 -8
>> jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java
>> Index: JDBCDescriptorsStore.java
>> ===================================================================
>> RCS file:
>> /home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v
>>
>> retrieving revision 1.28
>> retrieving revision 1.29
>> diff -u -r1.28 -r1.29
>> --- JDBCDescriptorsStore.java 7 Oct 2001 19:32:04 -0000 1.28
>> +++ JDBCDescriptorsStore.java 12 Jan 2002 16:04:26 -0000 1.29
>> @@ -1,7 +1,7 @@
>> /*
>> - * $Header:
>> /home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v
>> 1.28 2001/10/07 19:32:04 dirkv Exp $
>> - * $Revision: 1.28 $
>> - * $Date: 2001/10/07 19:32:04 $
>> + * $Header:
>> /home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v
>> 1.29 2002/01/12 16:04:26 dirkv Exp $
>> + * $Revision: 1.29 $
>> + * $Date: 2002/01/12 16:04:26 $
>> *
>> *
>> ====================================================================
>> *
>> @@ -86,7 +86,7 @@
>> * * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
>> * @author Dirk Verbeeck
>> - * @version $Revision: 1.28 $
>> + * @version $Revision: 1.29 $
>> */
>> public class JDBCDescriptorsStore
>> @@ -250,6 +250,11 @@
>> return statements;
>> }
>> + protected String getDatabaseConnectionTestStatement()
>> + {
>> + return "select 1 from objects where uri is null";
>> + }
>> + /**
>> * Initializes the data source with a set of parameters.
>> *
>> @@ -361,7 +366,18 @@
>> }
>> }
>> - + /**
>> + * Tries to reconnect if needed but doesn't report failure.
>> + */
>> + protected synchronized void connectIfNeededAndPossible() {
>> + try {
>> + connectIfNeeded();
>> + }
>> + catch (Throwable ex) {
>> + // ignore
>> + }
>> + }
>> + /**
>> * Initializes data source.
>> * <p/>
>> @@ -485,7 +501,17 @@
>> public boolean isConnected()
>> throws ServiceAccessException {
>> try {
>> - return ((connection != null) && (!connection.isClosed()));
>> + if ((connection == null) || (connection.isClosed())) {
>> + return false;
>> + }
>> + + PreparedStatement statement =
>> +
>> connection.prepareStatement(getDatabaseConnectionTestStatement());
>> + statement.executeQuery();
>> + + // testStatement executed without
>> throwing an exception
>> + return true;
>> + } catch (SQLException e) {
>> throw new ServiceAccessException(this, e);
>> }
>> @@ -537,10 +563,14 @@
>> if (!alreadyEnlisted) {
>> try {
>> -// getLogger().log("start",LOG_CHANNEL,Logger.DEBUG);
>> + // getLogger().log("start",LOG_CHANNEL,Logger.DEBUG);
>> +
>> + // test connection
>> + connectIfNeeded();
>> + // discard changes made outside
>> a tranaction
>> connection.rollback();
>> - } catch (SQLException e) {
>> + } catch (Exception e) {
>> throw new XAException(XAException.XAER_RMERR);
>> }
>> alreadyEnlisted=true;
>> @@ -656,6 +686,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -742,6 +773,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -827,6 +859,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -878,6 +911,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> }
>> }
>> @@ -920,6 +954,7 @@
>> statement.execute();
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -960,6 +995,7 @@
>> statement.execute();
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -987,6 +1023,7 @@
>> statement.execute();
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1035,6 +1072,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1079,6 +1117,7 @@
>> statement.execute();
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1131,6 +1170,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1167,6 +1207,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1233,6 +1274,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1341,6 +1383,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1408,6 +1451,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1474,6 +1518,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1563,6 +1608,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1642,6 +1688,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1708,6 +1755,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e);
>> } finally {
>> closeStatement(statement);
>> @@ -1727,6 +1775,7 @@
>> try {
>> statement.close();
>> } catch (SQLException e) {
>> + connectIfNeededAndPossible();
>> }
>> }
>> }
>> 1.15 +60 -18
>> jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java
>> Index: JDBCContentStore.java
>> ===================================================================
>> RCS file:
>> /home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v
>>
>> retrieving revision 1.14
>> retrieving revision 1.15
>> diff -u -r1.14 -r1.15
>> --- JDBCContentStore.java 7 Jan 2002 00:44:54 -0000 1.14
>> +++ JDBCContentStore.java 12 Jan 2002 16:04:26 -0000 1.15
>> @@ -1,7 +1,7 @@
>> /*
>> - * $Header:
>> /home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v
>> 1.14 2002/01/07 00:44:54 dirkv Exp $
>> - * $Revision: 1.14 $
>> - * $Date: 2002/01/07 00:44:54 $
>> + * $Header:
>> /home/cvs/jakarta-slide/src/stores/slidestore/reference/JDBCContentStore.java,v
>> 1.15 2002/01/12 16:04:26 dirkv Exp $
>> + * $Revision: 1.15 $
>> + * $Date: 2002/01/12 16:04:26 $
>> *
>> *
>> ====================================================================
>> *
>> @@ -90,7 +90,7 @@
>> * JDBC 2.0 compliant implementation of ContentStore.
>> *
>> * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
>> - * @version $Revision: 1.14 $
>> + * @version $Revision: 1.15 $
>> */
>> public class JDBCContentStore extends AbstractSimpleService
>> implements ContentStore {
>> @@ -100,10 +100,10 @@
>> public static final int BUFFER_SIZE = 2048;
>> -
>> - /** @deprecated */ // FIXME: remove this
>> +
>> + /** @deprecated */ // FIXME: remove this
>> public static final String CHARACTER_ENCODING = "8859_1";
>> -
>> + protected static final int REVISION_URI = 1;
>> protected static final int REVISION_NUMBER = 2;
>> protected static final int REVISION_CONTENT = 3;
>> @@ -160,6 +160,14 @@
>> return statements;
>> }
>> +
>> + /**
>> + * Returns a sql statement that can be used to test the
>> database connection.
>> + */
>> + protected String getDatabaseConnectionTestStatement() + {
>> + return "select 1 from revisioncontent where uri is null";
>> + }
>> /**
>> * Read parameters.
>> @@ -263,6 +271,17 @@
>> }
>> }
>> + /**
>> + * Tries to reconnect if needed but doesn't report failure.
>> + */
>> + protected synchronized void connectIfNeededAndPossible() {
>> + try {
>> + connectIfNeeded();
>> + }
>> + catch (Throwable ex) {
>> + // ignore
>> + }
>> + }
>> /**
>> * Initializes content store.
>> @@ -338,15 +357,25 @@
>> * @return boolean true if we are connected
>> * @exception ServiceAccessException Service access error
>> */
>> - public boolean isConnected()
>> - throws ServiceAccessException {
>> - try {
>> - return ((connection != null) && (!connection.isClosed()));
>> - } catch (SQLException e) {
>> - throw new ServiceAccessException(this, e);
>> - }
>> - }
>> - + public boolean isConnected()
>> + throws ServiceAccessException {
>> + try {
>> + if ((connection == null) || (connection.isClosed())) {
>> + return false;
>> + }
>> + + PreparedStatement statement =
>> +
>> connection.prepareStatement(getDatabaseConnectionTestStatement());
>> + statement.executeQuery();
>> + + // testStatement executed without
>> throwing an exception
>> + return true;
>> + + } catch (SQLException e) {
>> + throw new ServiceAccessException(this, e);
>> + }
>> + }
>> + //
>> ----------------------------------------------------- XAResource Methods
>> @@ -393,10 +422,14 @@
>> if (!alreadyEnlisted) {
>> try {
>> -// getLogger().log("start",LOG_CHANNEL,Logger.DEBUG);
>> + // getLogger().log("start",LOG_CHANNEL,Logger.DEBUG);
>> +
>> + // test connection
>> + connectIfNeeded();
>> + // discard changes made outside
>> a tranaction
>> connection.rollback();
>> - } catch (SQLException e) {
>> + } catch (Exception e) {
>> throw new XAException(XAException.XAER_RMERR);
>> }
>> alreadyEnlisted=true;
>> @@ -454,6 +487,7 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> } catch (RevisionNotFoundException e) {
>> getLogger().log("RevisionNotFoundException encountered
>> for " +
>> @@ -462,6 +496,7 @@
>> throw e; // we do NOT want this caught by next clause.
>> } catch (Exception e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> }
>> @@ -510,9 +545,11 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> } catch (IOException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> } catch(RevisionAlreadyExistException e) {
>> getLogger().log("RevisionNotFoundException encountered
>> for " +
>> @@ -521,6 +558,7 @@
>> throw e; // we do NOT want this caught by next clause.
>> } catch (Exception e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> } finally {
>> closeStatement(selectStatement);
>> @@ -570,9 +608,11 @@
>> } catch (SQLException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> } catch (IOException e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> } catch(RevisionNotFoundException e) {
>> getLogger().log("RevisionNotFoundException encountered
>> for " +
>> @@ -581,6 +621,7 @@
>> throw e; // we do NOT want this caught by next clause.
>> } catch (Exception e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> } finally {
>> closeStatement(selectStatement);
>> @@ -609,6 +650,7 @@
>> } catch (Exception e) {
>> getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>> + connectIfNeededAndPossible();
>> throw new ServiceAccessException(this, e.getMessage());
>> }
>>
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
>>
>>
>>
>
>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [Patch] Re: cvs commit: jakarta-slide/src/stores/slidestore/reference JDBCDescriptorsStore.java JDBCContentStore.java
Posted by Jason Harrop <ja...@xn.com.au>.
Actually, I have since added some debug to start() in the
JDBCDescriptorsStore (thinking along the same lines), and i'm surprised
how _infrequently_ its called. I had thought every propfind would
invoke start(), but it doesn't seem to! Do we expect it to? I had
thought so, thinking a new propfind was a new transaction...
public void start(Xid xid, int flags)
throws XAException {
super.start(xid, flags);
if (!alreadyEnlisted)
{
try {
long start = System.currentTimeMillis();
// test connection
connectIfNeeded();
getLogger().log("connectIfNeeded() took " +
(System.currentTimeMillis()-start),LOG_CHANNEL,Logger.INFO);
// discard changes made outside a tranaction
connection.rollback();
} catch (Exception e) {
throw new XAException(XAException.XAER_RMERR);
}
alreadyEnlisted=true;
} else {
getLogger().log("we were already enlisted, so not trying
connectIfNeeded()",LOG_CHANNEL,Logger.INFO);
}
}
cheers,
Jason
Dirk Verbeeck wrote:
> Yes, forgot to close that statement but as a positive side we know now
> that this code path is very common and we probably want to reduce the
> number of test select statements.
>
> org.apache.slide.store.AbstractStore.isConnected
> org.apache.slide.common.AbstractServiceBase.connectIfNeeded
> org.apache.slide.common.Uri.reconnectServices
> org.apache.slide.common.Namespace.getUri
>
> Move the code out of isConnected and into a method that is only called
> at the start of a transaction and in the error handler.
>
> Thanks,
> Dirk
>
>
> Jason Harrop wrote:
>
>>Hi, as you might have suspected, all that seems to be required to fix
>>this is to close the statement that we use to check the connection
>>
>>A similar change is required in JDBCContentStore.
>>
>>cheers,
>>
>>Jason
>>
>>Index: JDBCDescriptorsStore.java
>>===================================================================
>>RCS file:
>>/home/cvspublic/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v
>>retrieving revision 1.29
>>diff -r1.29 JDBCDescriptorsStore.java
>>511c511
>><
>>---
>> > statement.close();
>>1784c1784
>>< }
>>\ No newline at end of file
>>---
>> > }
>>
>>Jason Harrop wrote:
>>
>>
>>>Hello Dirk
>>>
>>>With Slide built today to test this patch, Oracle now throws:
>>>
>>>org.apache.slide.common.ServiceAccessException: Service
>>>slidestore.reference.JDBCDescriptorsStore@362012 access error :
>>>ORA-01000: maximum open cursors exceeded
>>>
>>> at
>>>slidestore.reference.JDBCDescriptorsStore.isConnected(JDBCDescriptorsStore.java:516)
>>>
>>> at
>>>org.apache.slide.store.AbstractStore.isConnected(AbstractStore.java:300)
>>> at
>>>org.apache.slide.common.AbstractServiceBase.connectIfNeeded(AbstractServiceBase.java:209)
>>>
>>> at org.apache.slide.common.Uri.reconnectServices(Uri.java:262)
>>> at org.apache.slide.common.Namespace.getUri(Namespace.java:675)
>>> at org.apache.slide.common.Namespace.getUri(Namespace.java:647)
>>> at org.apache.slide.common.Namespace.getUri(Namespace.java:635)
>>> at
>>>org.apache.slide.security.SecurityImpl.hasPermission(SecurityImpl.java:438)
>>> at
>>>org.apache.slide.security.SecurityImpl.checkPermission(SecurityImpl.java:407)
>>>
>>> at
>>>org.apache.slide.security.SecurityImpl.checkCredentials(SecurityImpl.java:379)
>>>
>>> at
>>>org.apache.slide.structure.StructureImpl.retrieve(StructureImpl.java:187)
>>> at org.apache.slide.content.ContentImpl.retrieve(ContentImpl.java:325)
>>> at org.apache.slide.content.ContentImpl.retrieve(ContentImpl.java:305)
>>>
>>>.. or from somewhere else in ContentImpl.
>>>
>>>Please not, this happens while Slide is being started (or if not then,
>>>then after one or two propfinds), without me doing anything to kill the
>>>database connection.
>>>
>>>Also, this is with the JDBCDescriptorsStore and FileCOntentStore - i've
>>>never had the open cursors problem with the JDBCDescriptorsStore before.
>>>
>>>The goods news is that if i do shutdown Oracle and start it up again, it
>>>does as least reconnect because of the new code in transaction start
>>>(and the fact that even the read-only webdav methods use transactions :) ).
>>>
>>>thanks,
>>>
>>>Jason
>>>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: [Patch] Re: cvs commit:
jakarta-slide/src/stores/slidestore/reference JDBCDescriptorsStore.java
JDBCContentStore.java
Posted by Dirk Verbeeck <di...@pandora.be>.
Yes, forgot to close that statement but as a positive side we know now
that this code path is very common and we probably want to reduce the
number of test select statements.
org.apache.slide.store.AbstractStore.isConnected
org.apache.slide.common.AbstractServiceBase.connectIfNeeded
org.apache.slide.common.Uri.reconnectServices
org.apache.slide.common.Namespace.getUri
Move the code out of isConnected and into a method that is only called
at the start of a transaction and in the error handler.
Thanks,
Dirk
Jason Harrop wrote:
>
> Hi, as you might have suspected, all that seems to be required to fix
> this is to close the statement that we use to check the connection
>
> A similar change is required in JDBCContentStore.
>
> cheers,
>
> Jason
>
> Index: JDBCDescriptorsStore.java
> ===================================================================
> RCS file:
> /home/cvspublic/jakarta-slide/src/stores/slidestore/reference/JDBCDescriptorsStore.java,v
> retrieving revision 1.29
> diff -r1.29 JDBCDescriptorsStore.java
> 511c511
> <
> ---
> > statement.close();
> 1784c1784
> < }
> \ No newline at end of file
> ---
> > }
>
> Jason Harrop wrote:
>
> > Hello Dirk
> >
> > With Slide built today to test this patch, Oracle now throws:
> >
> > org.apache.slide.common.ServiceAccessException: Service
> > slidestore.reference.JDBCDescriptorsStore@362012 access error :
> > ORA-01000: maximum open cursors exceeded
> >
> > at
> > slidestore.reference.JDBCDescriptorsStore.isConnected(JDBCDescriptorsStore.java:516)
> >
> > at
> > org.apache.slide.store.AbstractStore.isConnected(AbstractStore.java:300)
> > at
> > org.apache.slide.common.AbstractServiceBase.connectIfNeeded(AbstractServiceBase.java:209)
> >
> > at org.apache.slide.common.Uri.reconnectServices(Uri.java:262)
> > at org.apache.slide.common.Namespace.getUri(Namespace.java:675)
> > at org.apache.slide.common.Namespace.getUri(Namespace.java:647)
> > at org.apache.slide.common.Namespace.getUri(Namespace.java:635)
> > at
> > org.apache.slide.security.SecurityImpl.hasPermission(SecurityImpl.java:438)
> > at
> > org.apache.slide.security.SecurityImpl.checkPermission(SecurityImpl.java:407)
> >
> > at
> > org.apache.slide.security.SecurityImpl.checkCredentials(SecurityImpl.java:379)
> >
> > at
> > org.apache.slide.structure.StructureImpl.retrieve(StructureImpl.java:187)
> > at org.apache.slide.content.ContentImpl.retrieve(ContentImpl.java:325)
> > at org.apache.slide.content.ContentImpl.retrieve(ContentImpl.java:305)
> >
> > .. or from somewhere else in ContentImpl.
> >
> > Please not, this happens while Slide is being started (or if not then,
> > then after one or two propfinds), without me doing anything to kill the
> > database connection.
> >
> > Also, this is with the JDBCDescriptorsStore and FileCOntentStore - i've
> > never had the open cursors problem with the JDBCDescriptorsStore before.
> >
> > The goods news is that if i do shutdown Oracle and start it up again, it
> > does as least reconnect because of the new code in transaction start
> > (and the fact that even the read-only webdav methods use transactions :) ).
> >
> > thanks,
> >
> > Jason
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>