Ho queste poche e banali righe:
codice:
OracleConnection Connection;
Connection = new OracleConnection();
Connection.ConnectionString = "...";
Connection.Open();
OracleCommand Command;
Command = new OracleCommand();
Command.Connection = Connection;
Command.CommandType = System.Data.CommandType.Text;
Command.CommandText = sql;
DataAdapter = new OracleDataAdapter(Command);
Table = new DataTable("Table");
DataAdapter.Fill(Table);
Creo una connessione la apro, l'attribuisco ad un command e tramite un
DataAdapter riempio una tabella.
Successivamente per verificare se il problema fosse del dataadapter invece
che riempire una tabella ho utilizzato un datareader:
codice:
OracleDataReader dr = Command.ExecuteReader();
Ho queste poche e banali righe:
codice:
OracleConnection Connection;
Connection = new OracleConnection();
Connection.ConnectionString = "...";
Connection.Open();
OracleCommand Command;
Command = new OracleCommand();
Command.Connection = Connection;
Command.CommandType = System.Data.CommandType.Text;
Command.CommandText = sql;
DataAdapter = new OracleDataAdapter(Command);
Table = new DataTable("Table");
DataAdapter.Fill(Table);
Creo una connessione la apro, l'attribuisco ad un command e tramite un
DataAdapter riempio una tabella.
Successivamente per verificare se il problema fosse del dataadapter invece
che riempire una tabella ho utilizzato un datareader:
codice:
OracleDataReader dr = Command.ExecuteReader();
Ho queste poche e banali righe:
codice:
OracleConnection Connection;
Connection = new OracleConnection();
Connection.ConnectionString = "...";
Connection.Open();
OracleCommand Command;
Command = new OracleCommand();
Command.Connection = Connection;
Command.CommandType = System.Data.CommandType.Text;
Command.CommandText = sql;
DataAdapter = new OracleDataAdapter(Command);
Table = new DataTable("Table");
DataAdapter.Fill(Table);
Creo una connessione la apro, l'attribuisco ad un command e tramite un
DataAdapter riempio una tabella.
Successivamente per verificare se il problema fosse del dataadapter invece
che riempire una tabella ho utilizzato un datareader:
codice:
OracleDataReader dr = Command.ExecuteReader();
Il problema è sempre lo stesso nel momento in cui eseguo il reader o faccio
il fill con il dataadpter l'operazione è lunghissima.
Alcune considerazioni:
- la query è banale e fatta tramite sqldeveloper (o altro programma simile)
è istantanea
- tramite uno sniffer di rete abbiamo verificato che il server db
restituisce subito il dato ma il programma "sta fermo" come se aspettasse un
qualche timeout
Aggiungo la connectionstring in caso possa dipendere da questo:
codice:
"Data Source=(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = server1)(PORT =1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = server2)(PORT =1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = server3)(PORT =1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =(SERVER = DEDICATED)
(SERVICE_NAME = nomeservice))); User ID=user; Password=pwd;"
Qualcuno ha qualche idea di cosa possa essere il problema?
Grazie
--
Claudio P.