I am using a database Oracle 9i with ASP.NET 2.0 and occurs this error
ORA-12571: TNS:packet writer failure
web.config
Code:
<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
<add key="hibernate.dialect" value="NHibernate.Dialect.Oracle9Dialect"/>
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.OracleClientDriver"/>
<add key="hibernate.connection.connection_string" value="Data Source=xxx; User Id=xxx; Password=xxx" />
<add key="hibernate.show_sql" value="true"/>
</nhibernate>
example of my code:
Code:
public Entidade getEntidade(){
Entidade entidade = (Entidade)session.Load(typeof(Entidade), "0000486");
return entidade;
}
[OracleException (0x80131938): ORA-12571: TNS:falha do gravador do pacote
]
System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) +204
System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) +1020
System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, ArrayList& resultParameterOrdinals) +25
System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior) +138
System.Data.OracleClient.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior) +4
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +9
NHibernate.Impl.BatcherImpl.ExecuteReader(IDbCommand cmd) +97
NHibernate.Loader.Loader.GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session) +175
NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) +243
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) +65
NHibernate.Loader.EntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId) +129
NHibernate.Loader.EntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject) +15
NHibernate.Persister.EntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session) +209
[ADOException: could not load: [Apolo.Framework.Model.Entidade#0000486]]
NHibernate.Persister.EntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session) +279
NHibernate.Impl.SessionImpl.DoLoad(Type theClass, Object id, Object optionalObject, LockMode lockMode, Boolean checkDeleted) +576
NHibernate.Impl.SessionImpl.DoLoadByClass(Type clazz, Object id, Boolean checkDeleted, Boolean allowProxyCreation) +119
NHibernate.Impl.SessionImpl.Load(Type clazz, Object id) +38
Apolo.Framework.Model.Entidade.getEntidade() in C:\Inetpub\wwwroot\TableModule\Framework\Apolo.Framework\Domain\Entidade.cs:49
_Default.Page_Load(Object sender, EventArgs e) in c:\Inetpub\wwwroot\TableModule\Web\Default.aspx.cs:17
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
The same code works for Sql Server...