jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: JDBC PreparedStatement Cache
Date Thu, 08 Sep 2016 09:45:32 GMT
On 8 September 2016 at 06:38, Felix Schumacher
<felix.schumacher@internetallee.de> wrote:
>
>
> Am 8. September 2016 01:17:52 MESZ, schrieb sebb <sebbaz@gmail.com>:
>>It seems to me that it ought to be possible to re-use a
>>PreparedStatement somehow in JMeter.
>>Surely re-use is one of the functions of a PreparedStatement?
>>
>>However I've always thought that pooling across threads (or indeed
>>caching across threads) does not make sense given that threads are
>>supposed to represent independent users.
>>That sort of re-use just reduces the load on the database server, when
>>the main point is surely to test the server.
>
> I am not sure I can follow you. I read it as: first, you are in favour to remove or cache
as it made connections between the threads. Second, you want a new way to keep a connection
(and prepared statements) for the whole test run for each thread.
>
> Right?

Yes. A cache that shares statements (or connections) between threads
does not make sense to me.

However it should be possible to re-use a prepared statement.

> My concern was about the statements that are not reachable by the client and are not
closed, which again will lead to a memory leak. So I think we should close the statements
in the current implementation.

Agreed.

I think prepared statements should operate more like HTTP connections.
An HTTP connection is reused unless JMeter (or the server) explicitly
closes the connection.
[However HTTP connections are not shared between threads.]

This is not an exact analogy, but is done for the same reason: threads
need to be independent.

Mime
View raw message