-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Oracle Error: TNS Packet Failsure
PostPosted: Tue May 09, 2006 12:49 pm 
Newbie

Joined: Thu May 04, 2006 12:20 pm
Posts: 4
I am getting the oracle error ORA12571: TNS: packet writer failure when I run HQL commands but not when I run ICriteria commands.

Example, this works:

return (User) session.CreateCriteria(typeof(User))
.Add(Expression.Eq("LoginId", "mfletche"))
.UniqueResult();

But this does not:

IQuery query = session.CreateQuery("from User u where u.LoginId = :LoginId");
query.SetParameter("LoginId", "mfletche");
return (User) query.UniqueResult();




Hibernate version:

1.0.2

Mapping documents:

<class name="User" table="calendar_user">

<id name="Id" column="user_id1" type="Int64">
<generator class="native" />
</id>

<property name="LoginId" column="login_id1" type="AnsiString" />

</class>

Code between sessionFactory.openSession() and session.close():

IQuery query = session.CreateQuery("from User u where u.LoginId = ?");
query.SetParameter(0, loginId);

return (User) query.UniqueResult();

Full stack trace of any exception that occurs:
[OracleException: ORA-12571: TNS:packet writer failure
]
System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc)
System.Data.OracleClient.OracleCommand.Execute(OciHandle statementHandle, CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle& rowidDescriptor, ArrayList& refCursorParameterOrdinals)
System.Data.OracleClient.OracleCommand.Execute(OciHandle statementHandle, CommandBehavior behavior, ArrayList& refCursorParameterOrdinals)
System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior)
System.Data.OracleClient.OracleCommand.ExecuteReader()
System.Data.OracleClient.OracleCommand.System.Data.IDbCommand.ExecuteReader()
NHibernate.Impl.BatcherImpl.ExecuteReader(IDbCommand cmd)
NHibernate.Loader.Loader.GetResultSet(IDbCommand st, RowSelection selection, ISessionImplementor session)
NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes)
NHibernate.Hql.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters)
NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)

[ADOException: Could not execute query]
NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
NHibernate.Impl.QueryImpl.List()
NHibernate.Impl.AbstractQueryImpl.UniqueResult()
PetroCanada.CorpComm.Calendar.DataSession.GetUserSettings(String loginId) in c:\documents and settings\mfletche\desktop\hibernateexample\corpcommcalendar\petrocanada.corpcomm.calendar\datasession.cs:45
PetroCanada.CorpComm.Calendar.Website._Default.PopulateCalendarSelector() in C:\Documents and Settings\mfletche\Desktop\HibernateExample\CorpCommCalendar\PetroCanada.CorpComm.Calendar.Website\Default.aspx.cs:93
PetroCanada.CorpComm.Calendar.Website._Default.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\mfletche\Desktop\HibernateExample\CorpCommCalendar\PetroCanada.CorpComm.Calendar.Website\Default.aspx.cs:43
System.Web.UI.Control.OnLoad(EventArgs e)
System.Web.UI.Control.LoadRecursive()
System.Web.UI.Page.ProcessRequestMain()

Name and version of the database you are using:

Oracle 9.2

The generated SQL (show_sql=true):

select user0_.user_id as user_id, user0_.login_id as login_id from calendar_user user0_ where (user0_.login_id=:p0)
:p0 = 'mfletche'

Debug level Hibernate log excerpt:

Its too much, ask for a copy if you would like it.


Top
 Profile  
 
 Post subject: Re: Oracle Error: TNS Packet Failsure
PostPosted: Tue May 09, 2006 5:35 pm 
Regular
Regular

Joined: Fri Jan 27, 2006 2:32 pm
Posts: 102
Location: California, USA
mfletche wrote:
I am getting the oracle error ORA12571: TNS: packet writer failure when I run HQL commands but not when I run ICriteria commands.


I had this error for a while. It turned out to only happen on one machine. Parts of my application would work fine, but a particular form would always cause this error. On other machines, that form would run fine.

So my questions to you are; does it work on any machines? What driver version are you using?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.