Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Problem closing statement after xa_end: msg#00249

apache.db.derby.devel

Subject: Re: Problem closing statement after xa_end

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Kathey Marsden wrote:
> In Derby the default schema is a schema with the user name.
> But until you create a table that schema doesn't actually exist.
>
> In XA, a BrokeredStatement will try to create a new local connection if
> the statement is used outside of an xa connection, even if it is just
> to close the statement. This causes a lock timeout trying to get the
> default schema if the xa transaction created the first table in the
> default (user) schema.
>
> For example, the following code causes a lock timeout on stmt.close().
> ...
>
>
> conn = xaConnection.getConnection();
> Statement stmt = conn.createStatement();
> xaResource.start(xid,XAResource.TMNOFLAGS);
> // creating the first table creates the default
> // schema which corresponds to the user
> stmt.executeUpdate("create table mytab (i int)");
> xaResource.end(xid,XAResource.TMSUCCESS);
> xaResource.prepare(xid);
>
> //Statement.close() tries to get the realConnection and finds it null so
> // tries to create a new one and times out looking for the default
> //schema descriptor. stmt.execute() etc. have the same problem
> stmt.close();
>
>
> Is this a bug or expected behaviour?

I would say one possible optimization and one bug.

optimization) A Statement.close() on a "disconnected" Statement object
is not optimised to be a no-op on Statement.close(). I can look into
this as I am looking at some consistency issues with closed statements
for pooled and XA connections.

bug) A connection request that has a default schema that is being
created by another transaction will block until that transaction
completes (or time out). Probably in this situation the connection
request should be succeed as if the schema does not exist.

Dan.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBdy3EIv0S4qsbfuQRArqJAKCE1mV6RqmvKM6aQpPI8nND+FnSAQCgr0P8
pM0e4FFjFvipSAwsOEFpo7E=
=TM4R
-----END PGP SIGNATURE-----




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
version-control...    qnx.openqnx.dev...    redhat.rhn.user...    ietf.openpgp/20...    mail.mutt.user/...    web.microformat...    java.sync4j.use...    education.ezpro...    user-groups.blu...    solaris.manager...    org.fitug.debat...    technology.erps...    politics.activi...    linux.redhat.fe...    bug-tracking.ma...    xfce.user/2004-...    hams/2004-11/ms...    kde.users.pim/2...    culture.cooking...    freebsd.devel.x...    gnu.m4.adhoc/20...    ngpt.user/2002-...    apple.fink.deve...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation