Home    |    Concepts   |   API   |   Samples
Concepts
Database Connections
A database connection is a connection to a source of geographic data stored in a DBMS. It represents the ArcSDE server, which can respond to requests for geographic information. Hence, the first step in using ArcSDE is to connect with an ArcSDE server.

To establish a connection, the application must provide the following information:

  • The name of the host server for the ArcSDE service
  • The name of the service
  • The name of the database (not applicable for Oracleョ)
  • The user name and password for the DBMS

ArcSDE processes the connection request on the specified host and returns a connection handle to the application once a connection is established. All operations performed using this connection are executed as the named DBMS user.

You can use operating system environment variables to define the server, instance, database, user name, and password. While supported, using the password variable isn't recommended because it can compromise your security. Pass NULL for any argument for which the variable is set.


ArcSDE Services
API Comparison

 

The variables are:

  • SDESERVER葉he name of the ArcSDE server
  • SDEINSTANCE葉he name of the ArcSDE instance
  • SDEDATABASE葉he name of the ArcSDE database (if required by the underlying DBMS)
  • SDEUSER葉he user name
  • SDEPASSWORD葉he user's password

Connections in a multithreaded environment

By default, simultaneous access of a single ArcSDE connection by multiple threads is not supported. This guarantees the best performance when invoking methods on an established connection. To enforce a concurrency mechanism, which is required when building multithreaded applications, one of the concurrency schemes must be adopted. Please consult the Database Connections API in the API section to learn more about implementing the concurrent mechanism.

Database transactions

Associated with a connection are transactions. Transactions are a property of an ArcSDE connection and bind operations so that an entire set of changes are either recorded or rejected. For example, if a set of parcels is being updated in a particular order, you can use a transaction to define the beginning and end of the changes so that all changes are posted together. If a set of changes can稚 be successfully inserted, the entire transaction is rejected. All transactions end when a user disconnects.

There are several levels of transactions at work within ArcSDE. At the lowest level, ArcSDE and the DBMS are logging transactions for individual records. Above that, the application may choose to group operations with a transaction. ArcSDE provides API functions to start, commit, and rollback transactions. Additional functions are available to set an autocommit interval that forces intermediate commits after a specified number of features have been modified.

Send your comments to: Site Administrator | Terms of Use | PRIVACY | Copyright ゥ ESRI.