Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object "TABLENAME" is in use [CORE998] #1409

Closed
firebird-automations opened this issue Nov 13, 2006 · 6 comments
Closed

object "TABLENAME" is in use [CORE998] #1409

firebird-automations opened this issue Nov 13, 2006 · 6 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Daniel Cola?o (lightyearsaway)

I've downloaded and installed Firebird-2.0.0.12748-0-Win32.exe, having previously uninstalled Firebird 1.5, which I regularly use.

I created a database and tried to run the following script:

create table PROFILES (
PRF_ID char(1) not null,
DESCRIPTION varchar(15),
constraint PRF_PK primary key (PRF_ID));

create table USERS (
USR_ID varchar(12) not null,
LASTNAME varchar(15) not null,
NAME varchar(40) not null,
PROFILE char(1) default '2' not null,
PASSWD varchar(32) not null,
FORCE_NEW_PASS char(1) not null,
IS_ACTIVE char(1) default 'Y' not null,
constraint USR_PK primary key (USR_ID),
constraint USR_FK1 foreign key (PROFILE) references PROFILES (PRF_ID),
constraint USR_CHK1 check (FORCE_NEW_PASS in ('Y', 'N')),
constraint USR_CHK2 check (IS_ACTIVE in ('Y', 'N')));

...when the second statement is run I receive the following error:

ISC ERROR CODE:335544345

ISC ERROR MESSAGE:
lock conflict on no wait transaction
unsuccessful metadata update
object PROFILES is in use

Statement: create table USERS (
USR_ID varchar(12) not null,
LASTNAME varchar(15) not null,
NAME varchar(40) not null,
PROFILE char(1) default '2' not null,
PASSWD varchar(32) not null,
FORCE_NEW_PASS char(1) not null,
IS_ACTIVE char(1) default 'Y' not null,
constraint USR_PK primary key (USR_ID),
constraint USR_FK1 foreign key (PROFILE) references PROFILES (PRF_ID),
constraint USR_CHK1 check (FORCE_NEW_PASS in ('Y', 'N')),
constraint USR_CHK2 check (IS_ACTIVE in ('Y', 'N')))

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Can't reproduce with isql and both AUTODDL ON and OFF

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

What tool was used to run the script?

@firebird-automations
Copy link
Collaborator Author

Commented by: Baldur F?rchau (fuerchau)

I have the same Problem now:

Firebird 2.0.0.12748
ODBCDriver: Firebird_ODBC_2.0.0-Win32.exe
ADO-Version 2.81

The following Code produce this error allways, it does no matter, which tool i use (VB6 SP6, Excel97 VB-Macro)

Option Explicit

Private Const DBName = "D:\Downloads\FTKENNZAHLEN.FDB"

Public Sub TestFB()
Dim xLocal As New ADODB.Connection
Dim xCmd As New ADODB.Command
Dim xRCD As New ADODB.Recordset
Dim xSQL As String
Dim xTable As String

With xLocal
    \.ConnectionString = "DRIVER=Firebird/InterBase\(r\) driver;DBNAME=" & DBName & ";Character Set=NONE;Dialect=3;NoWait=Y;"
    \.IsolationLevel = adXactReadCommitted
    \.Properties\("User Id"\) = "SYSDBA"
    \.Properties\("Password"\) = "masterkey"
    \.CursorLocation = adUseServer

    Err\.Clear
    \.Open
    \.IsolationLevel = adXactReadCommitted
    
    
    xTable = "XTEST" & Hex$\(12345\)

    \.BeginTrans
    xSQL = "Create table " & xTable & " \(KeyF char\(1\) not null, Value0 integer not null\) "
    \.Execute xSQL, , adExecuteNoRecords
    \.Execute "alter table " & xTable & \_
             " add constraint PK\_" & xTable & \_
             " Primary Key\(KeyF\) ", , adExecuteNoRecords
    \.CommitTrans
            
    With xCmd
        \.CommandText = "select \* from " & xTable
        \.CommandType = adCmdText
        Set \.ActiveConnection = xLocal
        With xRCD
            \.CursorLocation = adUseClient
            Err\.Clear
            \.Open xCmd, , adOpenDynamic, adLockOptimistic
            
            xLocal\.BeginTrans
            \.AddNew
            \!keyf = "A"
            \!Value0 = 1
            \.AddNew
            \!keyf = "B"
            \!Value0 = 1
            \.UpdateBatch
            xLocal\.CommitTrans
                            
            \.Requery
            
            xLocal\.BeginTrans
            \!Value0 = 2
            \.Update
            \.MoveNext
            \!Value0 = 3
            \.Update
            xLocal\.CommitTrans
            
            \.Requery
            \.MoveNext
            
            xLocal\.BeginTrans
            \.Delete
            xLocal\.CommitTrans
            
            \.Requery
            
            \.Close
        End With
    End With
    
    \.BeginTrans
    \.Execute "drop table " & xTable, , adExecuteNoRecords
    \.CommitTrans
    
    \.Close
End With

End Sub

Error-Message:
[ODBC Firebird Driver][Firebird]unsuccessful metadata update
object XTEST3039 is in use

Errorcode: Hex 8004D016

Errorsource: Microsoft OLE DB Provider for ODBC Drivers

If i close the connection and open new, than i can drop the table.
This may be not a solution, because the open needs time in a client-server-application and i need a lot auf "temporary" tables.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 11314 ] => Firebird [ 15394 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Cannot Reproduce [ 5 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant