jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1050) Remove synchronization from JNDI data sources
Date Thu, 16 Aug 2007 14:07:30 GMT

    [ https://issues.apache.org/jira/browse/JCR-1050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520258
] 

Stefan Guggisberg commented on JCR-1050:
----------------------------------------

discussion on the dev list: 

---------- Forwarded message ----------
From: hannonpi <pih@wasabicowboy.com>
Date: Aug 8, 2007 2:20 AM
Subject: Re: [jira] Created: (JCR-1050) Remove synchronization from JNDI data sources
To: dev@jackrabbit.apache.org



See reply threaded below. Perhaps this should be moved into the Jira ticket?

-paddy


Thomas Mueller-6 wrote:
>
> Hi,
>
> I'm not sure if I understand this request for improvement.
>
>> Using datasources
>
> So you suggest to use DataSource.getConnection(..) instead of
> DriverManager.getConnection(..)? How do you get / create the
> datasource object, using JNDI? What about embedded applications where
> JNDI is not available?
>
> <response>
> I attached code to the ticket. Basically, this assumes that one is running
> inside an application server container. I am not suggesting this be the
> only driver, just that the JNDI drive should be built in such a way as to
> make use of the facilities provided by JEE containers (datasources, jta,
> etc).
> </response>
>
>> one should be able to rely on the application server to manage
>> PreparedStatement caches
>
> Do you suggest to create a new PreparedStatement for each request?
>
> <response>
> Yes, let the datasource or DB handle caching the PreparedStatements rather
> than holding them in an internal map.
> </response>
>
>> therefore pre-creating and holding onto the connection for long periods
>> of time should not be needed.
>
> Could you explain the advantages of 'not holding onto the connection'?
> I know that MySQL closes connections after 8 hours idle time, are
> there any other advantages?
>
> <response>
> Why hold onto resources one is not using? Let other threads take them.
> </response>
>
>> This relates to improvement JCR-313, however, that change did not address
>> the benefits one could see in using an application server controlled
>> datasource.
>
> What are those benefits?
>
> <response>
> Less code in jackrabbit for managing transactions and less synchronization
> leading to less potential threading conflicts.
> </response>
>
>> Even if jackrabbit does aim to use an embedded database such a system
>> could be configured to use datasources and
>
>> could benefit from the removal of the synchronization.
>
> In what way would removal of the synchronization be a benefit? Do you
> think it would be faster without synchronization? How would you make
> sure statements are executed in the right order?
>
> <response>
> Our experience over the last year or so of using CQ and CRX has lead us to
> believe that synchronization has serious performance penalties in high
> traffic situations. In general I would think that the fewer synchronized
> parts the better. This is not a request to entirely do away with
> synchronized blocks. However, looking at the DB drivers it seemed that the
> sole purpose of such blocks was to handle the fact that statements and
> connections where held open for long periods by the driver. I would assume
> that allowing multiple threads to read would have serious performance
> implications and that allowing the container and db to manage transactions
> one could decide on the transaction isolation level outside of the core
> code to deal with dirty reads etc.
> </response>
>
> Thanks,
> Thomas
>
>

--
View this message in context: http://www.nabble.com/-jira--Created%3A-%28JCR-1050%29-Remove-synchronization-from-JNDI-data-sources-tf4203578.html#a12044986
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

> Remove synchronization from JNDI data sources
> ---------------------------------------------
>
>                 Key: JCR-1050
>                 URL: https://issues.apache.org/jira/browse/JCR-1050
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>            Reporter: Padraic Hannon
>         Attachments: JNDI_Datasource_Changes.diff
>
>
> Using datasources one should be able to rely on the application server to manage PreparedStatement
caches therefore pre-creating and holding onto the connection for long periods of time should
not be needed. This relates to improvement JCR-313, however, that change did not address the
benefits one could see in using an application server controlled datasource. Even if jackrabbit
does aim to use an embedded database such a system could be configured to use datasources
and could benefit from the removal of the synchronization. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message