db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deepa Remesh" <drem...@gmail.com>
Subject Re: [DRDA] Question about DRDAStatement.initialize() method
Date Fri, 24 Feb 2006 00:15:26 GMT
Thanks Knut and Kathey. I will open a jira issue for changing use of
initialize or do it in a separate patch. For your answers to
question3, I have a small concern. Please see below.


> >>3. Is my comment for the new reuse method() okay? specifically, the
> >>comment about fields which should not be reset?
> >>"This method should reset all members of this class except the
> >>following which will be set at initial creation or set explicitly in
> >>the code: database, pkgnamcsn, pkgcnstkn, pkgid, pkgsn"
> >>
> >>
> >>
> > If these can be reset too that would be good and then get set whereever
> > the get set just for completeness.
>
> If you reset these variables, you'll need to call
> DRDAStatement.setPkgnamcsn() and DRDAStatement.setDatabase() later. In
> DRDAConnThread, setPkgnamcsn() and setDatabase() are not called after
> DRDAStatement.initialize(), so you'll have to add those calls there.

pkgnamcsn is the key used for statements added to stmtTable. It seems
to the basis for reusing statements. Resetting it seems a bit odd to
me. Code in Database.newDRDAStatement will look like this:

                DRDAStatement stmt = getDRDAStatement(pkgnamcsn);
		if (stmt != null) {
			stmt.reset();
			stmt.setPkgnamcsn(pkgnamcsn);
			stmt.setDatabase(this);
		}

Do you think it is okay?

Thanks,
Deepa

Mime
View raw message