close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 21 years ago

Closed 21 years ago

Last modified 21 years ago

#33 closed defect (invalid)

About what 'DBOpen' and 'DBClose' functions should return

Reported by: imendez Owned by: manuelb
Priority: normal Milestone:
Component: Math Version: head
Severity: normal Keywords:
Cc:

Description

'DBOpen' gives back:

  • TRUE when you connect successfully with the data base,
  • FALSE when data base connection can´t be established

Curiously, when the data base is already open, 'DBOpen' returns FALSE. My
question is what should return 'DBOpen' when this case befalls.

In my opinion, it should return TRUE, because the data base is open and FALSE
can be ambiguous.

Change History (4)

comment:1 Changed 21 years ago by manuelb

Owner: changed from danirus to manuelb

I will take care of this, Dani.

comment:2 Changed 21 years ago by manuelb

Status: newassigned

comment:3 Changed 21 years ago by manuelb

Resolution: invalid
Status: assignedclosed

There are many functions under many languages that, for any reason, cannot
return "correctly" if an error or warning ocurred or, like this case, return an error
while it can be considered as a normal end of operation.

Opening an already opened database must return an error or, at least, a warning,
so that the TOL programmer is aware of the fact that the database was not opened
by the TOL code, and therefore should not be closed.

You can check if the database is already opened using DBSelect, a function to
handle multiple databases under TOL.

Regards.

comment:4 Changed 21 years ago by manuelb

Ups!!!

The function that selects an opened database in TOL is DBActivate, not DBSelect!

Sorry for the inconvenience!

Note: See TracTickets for help on using tickets.