waliwali / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Database.recreatedb( **kwargs ) ibm_db_dbi.Error: ibm_db_dbi SQL1428N #92

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the suite test of django with db2
2. Go to django core tests and run runtests whit a db2 settings

What is the expected output? What do you see instead?
Creation/recreation of database go in error

What version of the product are you using? On what operating system?
ibm_db-1.0.5-py2.7-linux-x86_64.egg
Ubuntu 10.04

Please provide any additional information below.

this is the DB2 django settings

DATABASES = {
    'default': {
        'ENGINE': 'ibm_db_django',
        'NAME'  : 'test1',
        'HOST'  : 'localhost',
        'PORT': '50000',
        'USER'  : 'db2inst1',
        'PASSWORD' : 'db2',
    },
    'other': {
        'ENGINE': 'ibm_db_django',
        'NAME'  : 'test1',
        'HOST'  : 'localhost',
        'PORT': '50000',
        'USER'  : 'db2inst1',
        'PASSWORD' : 'db2',
    }
}

this is the stack trace

./runtests.py --noinput --settings=test_db2_composite
Error occurred during creation of test database: Error('[IBM][CLI 
Driver][DB2/LINUXX8664] SQL1005N  The database alias "testcb6d" already exists 
in either the local database directory or system database directory. 
SQLCODE=-1005',)Traceback (most recent call last):
  File "./runtests.py", line 287, in <module>
    failures = django_tests(int(options.verbosity), options.interactive, options.failfast, args)
  File "./runtests.py", line 154, in django_tests
    failures = test_runner.run_tests(test_labels, extra_tests=extra_tests)
  File "/django/Django-Trunk/django/test/simple.py", line 354, in run_tests
    old_config = self.setup_databases()
  File "/django/Django-Trunk/django/test/simple.py", line 291, in setup_databases
    test_db_name = connection.creation.create_test_db(self.verbosity, autoclobber=not self.interactive)
  File "/env/django14/local/lib/python2.7/site-packages/ibm_db_django-1.0.3-py2.7.egg/ibm_db_django/creation.py", line 178, in create_test_db
    Database.recreatedb( **kwargs )
  File "/env/django14/local/lib/python2.7/site-packages/ibm_db-1.0.5-py2.7-linux-x86_64.egg/ibm_db_dbi.py", line 482, in recreatedb
    raise _get_exception(inst)
ibm_db_dbi.Error: ibm_db_dbi::Error: [IBM][CLI Driver][DB2/LINUXX8664] SQL1428N 
 The application is already attached to "DB2INST1" while the command issued 
requires an attachment to "DB2INST1" for successful execution. SQLCODE=-1428

thanks
Simone

Original issue reported on code.google.com by s.federici@gmail.com on 7 Dec 2011 at 2:07

GoogleCodeExporter commented 9 years ago
Here someone has resolved by an uncatalog action
http://www.krishnababug.com/2010/04/sql1428n-application-is-already.html

Original comment by s.federici@gmail.com on 7 Dec 2011 at 3:45

GoogleCodeExporter commented 9 years ago
test_recreateDB.py also same error.

Maybe something is WRONG in my environment?

Ubuntu 9.7.4-0lucid3 - DB2 Express-C 9.7 Fix Pack 4 for Linux

$ SINGLE_PYTHON_TEST="test_recreateDB.py" python tests.py 
test_recreateDB (test_recreateDB.IbmDbTestCase) ... ERROR

======================================================================
ERROR: test_recreateDB (test_recreateDB.IbmDbTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/aldaran/workspaces/django/django_compositekey/ibm-db-read-only/IBM_DB/ibm_db/tests/test_recreateDB.py", line 15, in test_recreateDB
    obj.assert_expect(self.run_test_recreateDB)
  File "~/ibm-db-read-only/IBM_DB/ibm_db/testfunctions.py", line 75, in assert_expect
    self.assertEqual(self.capture(testFuncName), self.expected_LUW(callstack[1][1]))
  File "~/ibm-db-read-only/IBM_DB/ibm_db/testfunctions.py", line 22, in capture
    func()
  File "~/ibm-db-read-only/IBM_DB/ibm_db/tests/test_recreateDB.py", line 39, in run_test_recreateDB
    rc = ibm_db.recreatedb(conn_attach, database)
Exception: [IBM][CLI Driver][DB2/LINUXX8664] SQL1005N  The database alias 
"test001" already exists in either the local database directory or system 
database directory. SQLCODE=-1005

----------------------------------------------------------------------
Ran 1 test in 154.705s

FAILED (errors=1)
(django14)aldaran@romilda:~/workspaces/django/django_compositekey/ibm-db-read-on
ly/IBM_DB/ibm_db$ 

Original comment by s.federici@gmail.com on 7 Dec 2011 at 4:19

GoogleCodeExporter commented 9 years ago
There is somethng wrong,

Your test suite in my environment produce too many errors and failures,
maybe the DB2 Sample DATABASE is changed from the different revisions?

----------------------------------------------------------------------
Ran 153 tests in 72.189s

FAILED (failures=23, errors=14)

Original comment by s.federici@gmail.com on 7 Dec 2011 at 4:46

GoogleCodeExporter commented 9 years ago
Hi simone,
 The error which you are getting is due one of the reason mentioned over the following link http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.messages.sql.doc/doc/msql01035n.html.

You can resolve your issue by applying user response mentioned over the above 
link. 

If you are still getting the errors then let me know.

Original comment by rahul.pr...@in.ibm.com on 8 Dec 2011 at 2:03

GoogleCodeExporter commented 9 years ago

Original comment by rahul.pr...@in.ibm.com on 16 Apr 2012 at 8:52