-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem with hibernate sesson
PostPosted: Thu Feb 17, 2011 6:36 pm 
Newbie

Joined: Thu Feb 17, 2011 6:27 pm
Posts: 3
Hi,

I have problem xecuting hibernate query.

this is my code:
public List<Disability> findAll() {
log.debug("finding all User instances");
List<Disability> list = new ArrayList<Disability>();
try {
String queryString = "from Disability";
Query queryObject = getSession().createQuery(queryString);
list = (List<Disability>)queryObject.list();
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}finally {
getSession().close();
}
return list;

}

the problm in the line : list = (List<Disability>)queryObject.list();
for the first 7 or 8 times its working ok but for the 8 time the procces just stack in the attached line.

I'm using hibernate3.jar , jsf2 with apache6 sever.

thanks.


Top
 Profile  
 
 Post subject: Re: Problem with hibernate sesson
PostPosted: Fri Feb 18, 2011 5:35 am 
Regular
Regular

Joined: Fri Jan 28, 2011 11:44 am
Posts: 117
If you don't give us the stack and/or your mapping we cannot help you!


Top
 Profile  
 
 Post subject: Re: Problem with hibernate sesson
PostPosted: Fri Feb 18, 2011 6:45 am 
Newbie

Joined: Thu Feb 17, 2011 6:27 pm
Posts: 3
Hi ,

I don get any error message in the log.

this the Mapping:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/b ... ns-2.5.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/j ... ms-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/j ... ee-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/c ... xt-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/u ... il-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/a ... op-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/t ... tx-2.0.xsd">

<bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
</property>
<property name="url"
value="jdbc:sqlserver://LP104;database=INZ">
</property>
<property name="username" value="inz"></property>
<property name="password" value="inz"></property>
</bean>

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.HSQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
</bean>

<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<constructor-arg>
<ref bean="sessionFactory"/>
</constructor-arg>
</bean>

<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>





this the Pojo i'm using:

package com.ewave.inz.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="Disability"
,schema="dbo"
,catalog="INZ"
)
public class Disability {


@Id
@Column(name="Disability_ID", unique=true, nullable=false)
private String disabilityId;

@Column(name="Disability_Summary")
private String disabilitySummary;

@Column(name="Disability_Percentage_Disability")
private Float DisabilityPercentageDisability;

@Column(name="Disability_Issue")
private String DisabilityIssue;

@Column(name="Disability_Sub_Title")
private String DisabilitySubTitle;

@Column(name="A")
private Float a;

@Column(name="B")
private Float b;

@Column(name="Disability_Percentage_Type")
private String DisabilityPercentageType;

public Disability(){}

public Disability(String disabilityId, String disabilitySummary,
Float disabilityPercentageDisability, String disabilityIssue,
String disabilitySubTitle, Float a, Float b,
String disabilityPercentageType) {
super();
this.disabilityId = disabilityId;
this.disabilitySummary = disabilitySummary;
DisabilityPercentageDisability = disabilityPercentageDisability;
DisabilityIssue = disabilityIssue;
DisabilitySubTitle = disabilitySubTitle;
this.a = a;
this.b = b;
DisabilityPercentageType = disabilityPercentageType;
}

public String getDisabilityId() {
return disabilityId;
}

public void setDisabilityId(String disabilityId) {
this.disabilityId = disabilityId;
}

public String getDisabilitySummary() {
return disabilitySummary;
}

public void setDisabilitySummary(String disabilitySummary) {
this.disabilitySummary = disabilitySummary;
}

public Float getDisabilityPercentageDisability() {
return DisabilityPercentageDisability;
}

public void setDisabilityPercentageDisability(
Float disabilityPercentageDisability) {
DisabilityPercentageDisability = disabilityPercentageDisability;
}

public String getDisabilityIssue() {
return DisabilityIssue;
}

public void setDisabilityIssue(String disabilityIssue) {
DisabilityIssue = disabilityIssue;
}

public String getDisabilitySubTitle() {
return DisabilitySubTitle;
}

public void setDisabilitySubTitle(String disabilitySubTitle) {
DisabilitySubTitle = disabilitySubTitle;
}

public Float getA() {
return a;
}

public void setA(Float a) {
this.a = a;
}

public Float getB() {
return b;
}

public void setB(Float b) {
this.b = b;
}

public String getDisabilityPercentageType() {
return DisabilityPercentageType;
}

public void setDisabilityPercentageType(String disabilityPercentageType) {
DisabilityPercentageType = disabilityPercentageType;
}



}


Top
 Profile  
 
 Post subject: Re: Problem with hibernate sesson
PostPosted: Sat Feb 19, 2011 8:35 am 
Newbie

Joined: Thu Feb 17, 2011 6:27 pm
Posts: 3
.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.