db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-177) Unnecessary waiting within EmbedDatabaseMetaData.getIndexInfo()
Date Wed, 09 May 2007 19:38:15 GMT

     [ https://issues.apache.org/jira/browse/DERBY-177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-177:

    Attachment: tablelock.diff

After some more digging, I found out that the TransactionController.OPENMODE_LOCK_NOWAIT is
only supposed to make lock requests time out immediately if a table-level lock is requested.
So since the compilation normally uses row locking, it will have to wait for a timeout before
it gives up compiling in the nested transaction and restarts in the main transaction.

Attached is a hack which changes the lock mode to table locking when compiling in the nested
transaction. I have ran absolutely no tests on it other than the repro for DERBY-2584, which
now doesn't hang on the compilation.

> Unnecessary waiting within EmbedDatabaseMetaData.getIndexInfo()
> ---------------------------------------------------------------
>                 Key: DERBY-177
>                 URL: https://issues.apache.org/jira/browse/DERBY-177
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions:
>         Environment: Windows XP, JDK 1.4.2_07, derby embedded server
>            Reporter: Jörg von Frantzius
>         Attachments: tablelock.diff
> When setting up a new schema (creating tables, constraints and indexes), using a JDO
implementation's autocreate feature (JPOX JDO), the application hangs for 20 seconds in a
call to EmbedDatabaseMetaData.getIndexInfo(). The stacktrace is:
> Thread [main] (Suspended)
> 	Object.wait(long) line: not available [native method]
> 	ActiveLock.waitForGrant(int) line: not available
> 	LockSet.lockObject(Object, Lockable, Object, int, Latch) line: not available
> 	SinglePool.zeroDurationlockObject(Object, Lockable, Object, int) line: not available
> 	RowLockingRR(RowLocking3).zeroDurationLockRecordForWrite(Transaction, RecordHandle,
boolean, boolean) line: not available
> 	HeapController.lockRow(RecordHandle, int, boolean, int) line: not available
> 	HeapController.lockRow(RowLocation, int, boolean, int) line: not available
> 	B2IRowLocking3.lockRowOnPage(BTree, LeafControlRow, LeafControlRow, int, boolean, FetchDescriptor,
DataValueDescriptor[], RowLocation, int, int) line: not available
> 	B2IRowLocking3.lockNonScanPreviousRow(BTree, LeafControlRow, int, FetchDescriptor, DataValueDescriptor[],
RowLocation, OpenBTree, int, int) line: not available
> 	B2IController(BTreeController).doIns(DataValueDescriptor[]) line: not available
> 	B2IController(BTreeController).insert(DataValueDescriptor[]) line: not available
> 	B2IController.insert(DataValueDescriptor[]) line: not available
> 	TabInfoImpl.insertRowListImpl(RowList, TransactionController, RowLocation[], boolean)
line: not available
> 	TabInfoImpl.insertRow(ExecRow, TransactionController, boolean) line: not available
> 	DataDictionaryImpl.addDescriptorNow(TupleDescriptor, TupleDescriptor, int, boolean,
TransactionController, boolean) line: not available
> 	DataDictionaryImpl.addSPSParams(SPSDescriptor, TransactionController, boolean) line:
not available
> 	DataDictionaryImpl.updateSPS(SPSDescriptor, TransactionController, boolean, boolean,
boolean, boolean) line: not available
> 	SPSDescriptor.updateSYSSTATEMENTS(LanguageConnectionContext, int, TransactionController)
line: not available
> 	SPSDescriptor.getPreparedStatement(boolean) line: not available
> 	SPSDescriptor.getPreparedStatement() line: not available
> 	ExecSPSNode.generate(ByteArray) line: not available
> 	GenericStatement.prepMinion(LanguageConnectionContext, boolean, Object[], SchemaDescriptor,
boolean) line: not available
> 	GenericStatement.prepare(LanguageConnectionContext) line: not available
> 	GenericLanguageConnectionContext.prepareInternalStatement(String) line: not available
> 	EmbedPreparedStatement30(EmbedPreparedStatement).<init>(EmbedConnection, String,
boolean, int, int, int, int, int[], String[]) line: not available
> 	EmbedPreparedStatement30(EmbedPreparedStatement20).<init>(EmbedConnection, String,
boolean, int, int, int, int, int[], String[]) line: not available
> 	EmbedPreparedStatement30.<init>(EmbedConnection, String, boolean, int, int, int,
int, int[], String[]) line: not available
> 	Driver30.newEmbedPreparedStatement(EmbedConnection, String, boolean, int, int, int,
int, int[], String[]) line: not available
> 	EmbedConnection30(EmbedConnection).prepareMetaDataStatement(String) line: not available
> 	EmbedDatabaseMetaData.prepareSPS(String, String) line: not available
> 	EmbedDatabaseMetaData.getPreparedQuery(String) line: not available
> 	EmbedDatabaseMetaData.getIndexInfo(String, String, String, boolean, boolean) line: not
> [###### entry into Derby code ##########]
> 	CloudscapeAdapter(DatabaseAdapter).getExistingIndexes(Connection, DatabaseMetaData,
String, String, String) line: 1257
> 	ClassTable(TableImpl).getExistingCandidateKeys(Connection) line: 839
> 	ClassTable(TableImpl).validateCandidateKeys(Connection, boolean) line: 463
> 	ClassTable(TableImpl).validateConstraints(Connection, boolean) line: 293
> 	RDBMSManager$ClassAdder.addClassTablesAndValidate(String[], ClassLoaderResolver) line:
> 	RDBMSManager$ClassAdder.execute(Connection, ClassLoaderResolver) line: 2108
> 	RDBMSManager$ClassAdder(RDBMSManager$MgmtTransaction).execute(ClassLoaderResolver) line:
> 	RDBMSManager.addClasses(String[]) line: 469
> 	RDBMSManager.addClass(String) line: 481
> 	RDBMSManager(StoreManager).initialiseAutoStart() line: 333
> 	RDBMSManager.initialiseSchema(String, String, String, Connection) line: 379
> 	RDBMSManager.<init>(ClassLoaderResolver, AbstractPersistenceManagerFactory, String,
String) line: 243
> 	RDBMSManagerFactory.getStoreManager(ClassLoaderResolver, AbstractPersistenceManagerFactory,
String, String) line: 59
> 	PersistenceManagerImpl(AbstractPersistenceManager).<init>(AbstractPersistenceManagerFactory,
String, String) line: 179
> 	PersistenceManagerImpl.<init>(AbstractPersistenceManagerFactory, String, String)
line: 34
> 	PersistenceManagerFactoryImpl.getPersistenceManager(String, String) line: 606
> 	PersistenceManagerFactoryImpl.getPersistenceManager() line: 582
> 	ManagedObjectManager.getJdoPm() line: 536
> 	DefaultLeihnehmerTypManager(ManagedObjectManager).queryAll() line: 425
> 	DefaultLeihnehmerTypManager(ManagedObjectManager).getAll() line: 402
> 	PictitImporter.importContents(EList) line: 91
> 	PictitImporter.run(Object) line: 651
> 	PlatformActivator$1.run(Object) line: 228
> 	EclipseStarter.run(Object) line: 333
> 	EclipseStarter.run(String[], Runnable) line: 150
> 	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native
> 	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39
> 	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
> 	Method.invoke(Object, Object[]) line: 324
> 	Main.invokeFramework(String[], URL[]) line: 268
> 	Main.basicRun(String[]) line: 260
> 	Main.run(String[]) line: 887
> 	Main.main(String[]) line: 871

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

View raw message