Ho queste poche e banali righe:
Creo una connessione la apro, l'attribuisco ad un command e tramite uncodice: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);
DataAdapter riempio una tabella.
Successivamente per verificare se il problema fosse del dataadapter invece
che riempire una tabella ho utilizzato un datareader:
Ho queste poche e banali righe:codice:OracleDataReader dr = Command.ExecuteReader();
Creo una connessione la apro, l'attribuisco ad un command e tramite uncodice: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);
DataAdapter riempio una tabella.
Successivamente per verificare se il problema fosse del dataadapter invece
che riempire una tabella ho utilizzato un datareader:
Ho queste poche e banali righe:codice:OracleDataReader dr = Command.ExecuteReader();
Creo una connessione la apro, l'attribuisco ad un command e tramite uncodice: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);
DataAdapter riempio una tabella.
Successivamente per verificare se il problema fosse del dataadapter invece
che riempire una tabella ho utilizzato un datareader:
Il problema è sempre lo stesso nel momento in cui eseguo il reader o facciocodice:OracleDataReader dr = Command.ExecuteReader();
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:
Qualcuno ha qualche idea di cosa possa essere il problema?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;"
Grazie
--
Claudio P.

Rispondi quotando