Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028190Openbravo ERPA. Platformpublic2014-11-17 14:042015-05-11 11:09
Orekaria 
Orekaria 
normalmajoralways
closedfixed 
5
 
3.0PR15Q3 
alostale
Core
No
0028190: Stabilization: 'ant install.source' incorrectly reports that the database already exists when it should report that is opened
Stabilization: Install.source incorrectly report that the database already exists when it should report that is opened and the server should be stopped
In a working Openbravo instance:

1) Create a database connection to the database of an Openbravo instance
Execute at least one of these options:
- open pgAdmin (or other db tool that keeps db connection alive)
  open the database of instance
- start tomcat with the Openbravo instance

2) Install.source
in the openbravo directory of the selected instance
execute 'ant install.source'

Verify that the following error message is shown (INCORRECT):
build-create.xml:203: org.postgresql.util.PSQLException: ERROR: database "obtip" already exists

3) close database connections
stop tomcat or/and close pgAdmin session to the database
execute install.source again
Verify that the build is correctly executed


The problem:
The message is correctly reporting that the database exists BUT the real problem is that there are open connections to the database
No tags attached.
blocks defect 0029396RR15Q3 closed Retail Retail Modules Stabilization: RR15Q3 related 
Issue History
2014-11-17 14:04OrekariaNew Issue
2014-11-17 14:04OrekariaAssigned To => dmiguelez
2014-11-17 14:04OrekariaModules => Core
2014-11-17 14:04OrekariaTriggers an Emergency Pack => No
2014-11-17 14:05OrekariaSummaryStabilization: Install.source incorrectly report that the database already exists when it should report that is opened => Stabilization: 'ant install.source' incorrectly reports that the database already exists when it should report that is opened
2015-04-15 17:46hgbotCheckin
2015-04-15 17:46hgbotNote Added: 0076561
2015-04-15 17:46hgbotStatusnew => resolved
2015-04-15 17:46hgbotResolutionopen => fixed
2015-04-15 17:46hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e185fb4ea79d609124d683cb2da0308167be5b10 [^]
2015-04-15 17:47OrekariaRelationship addedblocks 0029396
2015-04-17 11:10OrekariaNote Added: 0076599
2015-04-17 12:31OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8290#r8290
2015-04-17 12:31OrekariaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8291#r8291
2015-04-20 14:21OrekariaStatusresolved => new
2015-04-20 14:21OrekariaResolutionfixed => open
2015-04-20 14:24hgbotCheckin
2015-04-20 14:24hgbotNote Added: 0076634
2015-04-20 14:24OrekariaNote Edited: 0076634bug_revision_view_page.php?bugnote_id=0076634#r8306
2015-04-20 14:25OrekariaNote Edited: 0076634bug_revision_view_page.php?bugnote_id=0076634#r8307
2015-04-21 15:54OrekariaAssigned Todmiguelez => platform
2015-04-21 15:55OrekariaCategory01. General setup => A. Platform
2015-04-21 15:55OrekariaAssigned Toplatform => Orekaria
2015-04-21 15:56OrekariaIssue Monitored: alostale
2015-04-21 15:56OrekariaReview Assigned To => alostale
2015-04-29 12:27OrekariaNote Added: 0076871
2015-04-29 12:27OrekariaStatusnew => scheduled
2015-04-29 12:27OrekariaStatusscheduled => resolved
2015-04-29 12:27OrekariaFixed in Version => 3.0PR15Q3
2015-04-29 12:27OrekariaResolutionopen => fixed
2015-05-07 22:16hudsonbotCheckin
2015-05-07 22:16hudsonbotNote Added: 0077129
2015-05-07 22:16hudsonbotCheckin
2015-05-07 22:16hudsonbotNote Added: 0077137
2015-05-11 11:09alostaleNote Added: 0077270
2015-05-11 11:09alostaleStatusresolved => closed

Notes
(0076561)
hgbot   
2015-04-15 17:46   
Repository: erp/devel/pi
Changeset: e185fb4ea79d609124d683cb2da0308167be5b10
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Wed Apr 15 17:31:04 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e185fb4ea79d609124d683cb2da0308167be5b10 [^]

Fixes issue 28190: The database will try to be dropped before being created

The problem was that the exception was raised because the database tried to be created.
Adding a 'DROP IF EXISTS' clause, the engine will properly report that the database is being accesed and cannot be dropped
We can drop the table because as of now, if the database already exists, the database is effectively dropped

---
M src-db/database/build-create.xml
---
(0076599)
Orekaria   
2015-04-17 11:10   
Message shown after patch:

/data/repos/tip/openbravo/src-db/database/build-create.xml:203: org.postgresql.util.PSQLException: ERROR: database "obtip" is being accessed by other users
  Detail: There is 1 other session using the database.
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
(0076634)
hgbot   
2015-04-20 14:24   
(edited on: 2015-04-20 14:25)
Repository: erp/devel/pi
Changeset: f5111981f65642f5beaf557d2f714a50d4aefd3b
Author: Rafa Alonso <rafael.alonso <at> openbravo.com>
Date: Mon Apr 20 14:19:07 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f5111981f65642f5beaf557d2f714a50d4aefd3b [^]

Related issue 28190: Failing to drop the database will cause the build to fail (II)

After Stefan feedback:
- the fix now makes use of the existing DROP in the "clean.database.POSTGRE" task. The change is that the build will but the build fail if the drop fails.

The "clean.database.POSTGRE" task is being accessed by the <target name="create.database"> task.

Note that the "clean.database.ORACLE" task has not been addressed in this changeset.

---
M src-db/database/build-create.xml
---

(0076871)
Orekaria   
2015-04-29 12:27   
Oracle message when tomcat is running and the install.source task is called:

clean.database.ORACLE:
      [sql] Executing commands
      [sql] Failed to execute: DROP USER TAD CASCADE
      [sql] java.sql.SQLSyntaxErrorException: ORA-01940: cannot drop a user that is currently connected
      [sql] 0 of 1 SQL statements executed successfully

prepare.database:

ORACLE.structure:
      [sql] Executing commands
      [sql] Failed to execute: DECLARE v_count NUMBER; BEGIN SELECT COUNT(*) INTO v_count FROM DBA_USERS WHERE USERNAME = 'TAD'; IF (v_count > 0) THEN RAISE_APPLICATION_ERROR(-20100, 'TAD ALREADY EXISTS. SELECT ANOTHER USER OR DROP IT FIRST'); END IF; END;

BUILD FAILED
(0077129)
hudsonbot   
2015-05-07 22:16   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/a1817f84bd8b [^]
Maturity status: Test
(0077137)
hudsonbot   
2015-05-07 22:16   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/a1817f84bd8b [^]
Maturity status: Test
(0077270)
alostale   
2015-05-11 11:09   
code reviewed + tested