[Hibernate-JIRA] Created: (HHH-5079) ManyToOne fails to bind via annotations in 3.5
by victor igumnov (JIRA)
ManyToOne fails to bind via annotations in 3.5
----------------------------------------------
Key: HHH-5079
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5079
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Final
Environment: java 1.6
Reporter: victor igumnov
I am trying to migrate our large 50+ entity hibernate application from 3.3 to 3.5, but it seems to be failing on annotated bindings that use @OneToMany. Perhaps this might be a hibernate-annotations bug? I have done various migrations from 3.0 to 3.3 without any issues until now. Any help is much appreciated.
Here is the full error. Basically ArticleComment Failing to reference Article.
I have included source for articlecomment/article and "datedpojo" the base class that both entities inherit from. Hope that helps.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jTransactionManager' defined in class path resource [c3p0.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [context.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: A Foreign key refering com.fab40.service.pojos.Article from com.fab40.service.pojos.ArticleComment has the wrong number of column. should be 2
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1317)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1076)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1234)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.fab40.StandAlone.main(StandAlone.java:27)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [context.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: A Foreign key refering com.fab40.service.pojos.Article from com.fab40.service.pojos.ArticleComment has the wrong number of column. should be 2
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 25 more
Caused by: org.hibernate.AnnotationException: A Foreign key refering com.fab40.service.pojos.Article from com.fab40.service.pojos.ArticleComment has the wrong number of column. should be 2
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:421)
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:111)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:541)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:523)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:380)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1206)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
... 32 more
*** ERROR [main]: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@1b1c7295{/,src/webapp}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jTransactionManager' defined in class path resource [c3p0.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [context.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: A Foreign key refering com.fab40.service.pojos.Article from com.fab40.service.pojos.ArticleComment has the wrong number of column. should be 2
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1317)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1076)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1234)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.fab40.StandAlone.main(StandAlone.java:27)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [context.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: A Foreign key refering com.fab40.service.pojos.Article from com.fab40.service.pojos.ArticleComment has the wrong number of column. should be 2
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1412)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 25 more
Caused by: org.hibernate.AnnotationException: A Foreign key refering com.fab40.service.pojos.Article from com.fab40.service.pojos.ArticleComment has the wrong number of column. should be 2
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:421)
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:111)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:541)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:523)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:380)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1206)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
... 32 more
*** ERROR [main]: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jTransactionManager' defined in class path resource [c3p0.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [context.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: A Foreign key refering com.fab40.service.pojos.Article from com.fab40.service.pojos.ArticleComment has the wrong number of column. should be 2:
org.hibernate.AnnotationException: A Foreign key refering com.fab40.service.pojos.Article from com.fab40.service.pojos.ArticleComment has the wrong number of column. should be 2
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:421)
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:111)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:541)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:523)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:380)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1206)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:717)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1469)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1317)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1076)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1234)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:222)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.fab40.StandAlone.main(StandAlone.java:27)
*** INFO [main]: Started SocketConnector@0.0.0.0:8090
package com.fab40.service.pojos;
import com.base.persistance.defaults.defaulters.DefaultBooleanValue;
import com.base.persistance.pojo.IndexedDatedPojo;
import com.fab40.annotations.PostablePage;
import com.fab40.annotations.VoteComment;
import com.fab40.pages.ViewArticle;
import org.hibernate.annotations.*;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;
import javax.persistence.*;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true, selectBeforeUpdate = true, dynamicInsert = true)
@Indexed
@Table(name = "articles")
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@PostablePage(pageClass = ViewArticle.class)
@VoteComment(clazz = ArticleComment.class)
public class Article extends IndexedDatedPojo implements IPicturePostable, ICategoryPostable, ISlug, IVote, IPublish {
private static final long serialVersionUID = 1L;
@Column(name = "up_vote_count", nullable = false)
private int upVoteCount = 0;
@Column(name = "down_vote_count", nullable = false)
private int downVoteCount = 0;
@Field(index = Index.TOKENIZED, store = Store.NO)
@Column(name = "subject", nullable = false, unique = true)
private String subject;
@Lob
@Column(name = "json", nullable = true)
private String json;
@ManyToOne
@JoinColumn(name = "user_id", nullable = false)
private User user;
@Column(name = "slug", nullable = false, unique = true)
private String slug;
@Lob
@Field(index = Index.TOKENIZED, store = Store.NO)
@Column(name = "body", nullable = false)
private String body;
@NotNull
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "category_id", nullable = false)
private Category category;
@Column(name = "image", nullable = false)
private String image;
@Column(name = "popularity", nullable = false)
private int popularity;
@Column(name = "producer_url", nullable = false)
private String producerUrl;
@Column(name = "author", nullable = false)
private String author;
@DefaultBooleanValue(true)
@Column(name = "published", nullable = false)
private Boolean published;
@Column(name = "date_published")
private Date datePublished;
@OneToMany(targetEntity = ArticleComment.class, mappedBy = "article", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY)
@Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
@OrderBy("created asc")
private Set<IComment> comments = new HashSet<IComment>();
public String getSubject() {
return subject;
}
public void setSubject(final String subject) {
this.subject = subject;
}
public String getBody() {
return body;
}
public void setBody(final String body) {
this.body = body;
}
public Category getCategory() {
return category;
}
public void setCategory(final Category category) {
this.category = category;
}
public void setImage(final String image) {
this.image = image;
}
public String getImage() {
return image;
}
public void setProducerUrl(final String producerUrl) {
this.producerUrl = producerUrl;
}
public String getProducerUrl() {
return producerUrl;
}
public void setAuthor(final String author) {
this.author = author;
}
public String getAuthor() {
return author;
}
public void setPublished(final Boolean published) {
this.published = published;
}
public Boolean getPublished() {
return published;
}
public void setComments(final Set<IComment> comments) {
this.comments = comments;
}
public Set<IComment> getComments() {
return comments;
}
public void setPopularity(final int popularity) {
this.popularity = popularity;
}
public int getPopularity() {
return popularity;
}
public void setUser(final User user) {
this.user = user;
}
public User getUser() {
return user;
}
public void setSlug(final String slug) {
this.slug = slug;
}
public String getSlug() {
return slug;
}
public void setUpVoteCount(final int upVoteCount) {
this.upVoteCount = upVoteCount;
}
public int getUpVoteCount() {
return upVoteCount;
}
public void setDownVoteCount(final int downVoteCount) {
this.downVoteCount = downVoteCount;
}
public int getDownVoteCount() {
return downVoteCount;
}
public void setDatePublished(final Date datePublished) {
this.datePublished = datePublished;
}
public Date getDatePublished() {
return datePublished;
}
public String getJson() {
return json;
}
public void setJson(String json) {
this.json = json;
}
}
package com.fab40.service.pojos;
import com.base.persistance.pojo.DatedPojo;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.*;
import javax.persistence.CascadeType;
import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.HashSet;
import java.util.Set;
@Entity
@org.hibernate.annotations.Entity(dynamicUpdate = true, selectBeforeUpdate = true, dynamicInsert = true)
@Table(name = "article_comments")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class ArticleComment extends DatedPojo implements IComment, IFeed, IVote {
private static final long serialVersionUID = 1L;
@Column(name = "up_vote_count", nullable = false)
private int upVoteCount = 0;
@Column(name = "down_vote_count", nullable = false)
private int downVoteCount = 0;
@OneToMany(mappedBy = "articleComment", cascade = CascadeType.ALL)
@Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
@LazyCollection(LazyCollectionOption.EXTRA)
private Set<FeedAction> feedActions = new HashSet<FeedAction>();
@ManyToOne
@JoinColumn(name = "user_id", nullable = false)
private User user;
@ManyToOne(optional = false)
@JoinColumn(name = "article_id", nullable = false)
private Article article;
@Lob
@Column(name = "body", nullable = false)
private String body;
public User getUser() {
return user;
}
public void setUser(final User user) {
this.user = user;
}
public Article getArticle() {
return article;
}
public void setArticle(final Article article) {
this.article = article;
}
public String getBody() {
return body;
}
public void setBody(final String body) {
this.body = body;
}
public IPostable getPostable() {
return article;
}
public void setPostable(final IPostable postable) {
article = (Article) postable;
}
public void setFeedActions(final Set<FeedAction> feedActions) {
this.feedActions = feedActions;
}
public Set<FeedAction> getFeedActions() {
return feedActions;
}
public void setUpVoteCount(final int upVoteCount) {
this.upVoteCount = upVoteCount;
}
public int getUpVoteCount() {
return upVoteCount;
}
public void setDownVoteCount(final int downVoteCount) {
this.downVoteCount = downVoteCount;
}
public int getDownVoteCount() {
return downVoteCount;
}
}
package com.base.persistance.pojo;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.base.persistance.defaults.defaulters.DefaultDateValue;
import com.base.persistance.defaults.defaulters.DateSaveType.DateSave;
@MappedSuperclass
public abstract class DatedPojo implements Serializable, BasePojo {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@DefaultDateValue(DateSave.SAVE_CREATED)
@Column(name = "created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date created = new Date();
@DefaultDateValue(DateSave.SAVE_UPDATED)
@Column(name = "updated", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date updated = new Date();
public DatedPojo() {
}
public DatedPojo(final int id) {
this.id = id;
}
/*
* (non-Javadoc)
*
* @see com.base.persistance.pojo.BasePojo#setCreated(java.util.Date)
*/
public void setCreated(final Date created) {
this.created = created;
}
/*
* (non-Javadoc)
*
* @see com.base.persistance.pojo.BasePojo#getCreated()
*/
public Date getCreated() {
return created;
}
/*
* (non-Javadoc)
*
* @see com.base.persistance.pojo.BasePojo#setUpdated(java.util.Date)
*/
public void setUpdated(final Date updated) {
this.updated = updated;
}
/*
* (non-Javadoc)
*
* @see com.base.persistance.pojo.BasePojo#getUpdated()
*/
public Date getUpdated() {
return updated;
}
/*
* (non-Javadoc)
*
* @see com.base.persistance.pojo.BasePojo#setId(long)
*/
public void setId(final int id) {
this.id = id;
}
/*
* (non-Javadoc)
*
* @see com.base.persistance.pojo.BasePojo#getId()
*/
public int getId() {
return id;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
BasePojo p = (BasePojo) obj;
if (getId() == 0 || p.getId() == 0) {
return false;
}
if (this.getId() == p.getId()) {
return true;
} else {
return false;
}
}
@Override
public int hashCode() {
return 29 + this.getId();
}
}
package com.base.persistance.pojo;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import org.hibernate.search.annotations.DocumentId;
@MappedSuperclass
public abstract class IndexedDatedPojo extends DatedPojo {
private static final long serialVersionUID = 1L;
@Id
@DocumentId
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
@Override
public void setId(final int id) {
this.id = id;
}
@Override
public int getId() {
return id;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Updated: (HHH-1804) Empty 'FetchingScrollableResultsImpl' throws SQLException
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804?page=c... ]
Gail Badner updated HHH-1804:
-----------------------------
Issue Type: Patch (was: Bug)
> Empty 'FetchingScrollableResultsImpl' throws SQLException
> ---------------------------------------------------------
>
> Key: HHH-1804
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804
> Project: Hibernate Core
> Issue Type: Patch
> Reporter: Maarten Winkels
> Assignee: Gail Badner
> Attachments: EmptyFetchJoinScrollTest.java, scroll-join-fetch-empty.patch
>
>
> When scrolling a HQL query with join fetch on a collection, that doesn't return any results, the following execption occurs:
> org.hibernate.exception.GenericJDBCException: could not perform sequential read of results (forward)
> at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:386)
> at org.hibernate.impl.FetchingScrollableResultsImpl.next(FetchingScrollableResultsImpl.java:55)
> at org.hibernate.test.joinfetch.EmptyFetchJoinScrollTest.testFetchJoinEmptyScroll(EmptyFetchJoinScrollTest.java:21)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at org.hibernate.test.TestCase.runTest(TestCase.java:161)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: java.sql.SQLException: No data is available
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.checkAvailable(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getColumnInType(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hibernate.type.StringType.get(StringType.java:18)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
> at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:375)
> ... 18 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Assigned: (HHH-1804) Empty 'FetchingScrollableResultsImpl' throws SQLException
by Gail Badner (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804?page=c... ]
Gail Badner reassigned HHH-1804:
--------------------------------
Assignee: Gail Badner
> Empty 'FetchingScrollableResultsImpl' throws SQLException
> ---------------------------------------------------------
>
> Key: HHH-1804
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804
> Project: Hibernate Core
> Issue Type: Bug
> Reporter: Maarten Winkels
> Assignee: Gail Badner
> Attachments: EmptyFetchJoinScrollTest.java, scroll-join-fetch-empty.patch
>
>
> When scrolling a HQL query with join fetch on a collection, that doesn't return any results, the following execption occurs:
> org.hibernate.exception.GenericJDBCException: could not perform sequential read of results (forward)
> at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:386)
> at org.hibernate.impl.FetchingScrollableResultsImpl.next(FetchingScrollableResultsImpl.java:55)
> at org.hibernate.test.joinfetch.EmptyFetchJoinScrollTest.testFetchJoinEmptyScroll(EmptyFetchJoinScrollTest.java:21)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at org.hibernate.test.TestCase.runTest(TestCase.java:161)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: java.sql.SQLException: No data is available
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.checkAvailable(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getColumnInType(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hibernate.type.StringType.get(StringType.java:18)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
> at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:375)
> ... 18 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-211) SharedReaderProvider: should own lock when testing for index state
by Sanne Grinovero (JIRA)
SharedReaderProvider: should own lock when testing for index state
------------------------------------------------------------------
Key: HSEARCH-211
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-211
Project: Hibernate Search
Issue Type: Bug
Components: directory provider
Reporter: Sanne Grinovero
Developing a new IndexReader I made a stress-test to compare performance to base readers, but got this when measuring SharedReaderProvider:
Exception in thread "pool-2-thread-13" org.apache.lucene.store.AlreadyClosedException: this IndexReader is closed
at org.apache.lucene.index.IndexReader.ensureOpen(IndexReader.java:163)
at org.apache.lucene.index.DirectoryIndexReader.isCurrent(DirectoryIndexReader.java:149)
at org.hibernate.search.reader.SharedReaderProvider.openReader(SharedReaderProvider.java:83)
at org.hibernate.search.query.FullTextQueryImpl.buildSearcher(FullTextQueryImpl.java:486)
at org.hibernate.search.query.FullTextQueryImpl.getResultSize(FullTextQueryImpl.java:528)
at org.hibernate.search.test.reader.performance.SearchActivity.doAction(SearchActivity.java:24)
at org.hibernate.search.test.reader.performance.AbstractActivity.run(AbstractActivity.java:54)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-305) Hibernate search doesn't work with criteria when it is not initialized laziily
by prabhu lal (JIRA)
Hibernate search doesn't work with criteria when it is not initialized laziily
------------------------------------------------------------------------------
Key: HSEARCH-305
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-305
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.0.1.GA
Environment: MYSQL,HIBERNATE 3.0 , Flex with dpHibernate
Reporter: prabhu lal
Attachments: QueryLoader.java
For the RIA applications complete object tree should be initialized(To achieve that there is work around available like dpHibernate). But hibernate search doesn't apply criteria to queried result because it returns the result on the basis of wether objectt is intialized by loading the criteria objects.Since there is no lazy intiaialization so all the objects are loaded andcomplete result will be return irrespctive of criteria.
code snipet from Hibernate Search API(org.hibernate.search.engine.QueryLoader.java.):
public List load(EntityInfo... entityInfos) {
final int maxResults = entityInfos.length;
if ( maxResults == 0 ) return EMPTY_LIST;
if ( entityType == null ) throw new AssertionFailure( "EntityType not defined" );
if ( criteria == null ) criteria = session.createCriteria( entityType );
DocumentBuilder builder = searchFactoryImplementor.getDocumentBuilders().get( entityType );
String idName = builder.getIdentifierName();
int loop = maxResults / MAX_IN_CLAUSE;
boolean exact = maxResults % MAX_IN_CLAUSE == 0;
if ( !exact ) loop++;
Disjunction disjunction = Restrictions.disjunction();
for (int index = 0; index < loop; index++) {
int max = index * MAX_IN_CLAUSE + MAX_IN_CLAUSE <= maxResults ?
index * MAX_IN_CLAUSE + MAX_IN_CLAUSE :
maxResults;
List ids = new ArrayList( max - index * MAX_IN_CLAUSE );
for (int entityInfoIndex = index * MAX_IN_CLAUSE; entityInfoIndex < max; entityInfoIndex++) {
ids.add( entityInfos[entityInfoIndex].id );
}
disjunction.add( Restrictions.in( idName, ids ) );
}
criteria.add( disjunction );
criteria.list(); //load all objects
//mandatory to keep the same ordering
List result = new ArrayList( entityInfos.length );
for (EntityInfo entityInfo : entityInfos) {
Object element = session.load( entityInfo.clazz, entityInfo.id );
if ( Hibernate.isInitialized( element ) ) { //This is true for all the objects,in case objects are eagrly intialized
//all existing elements should have been loaded by the query,
//the other ones are missing ones
result.add( element );
}
}
return result;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-362) When using hibernate-search3.1.0 GA, Search throws AlreadyClosedException under certain circumstances
by S Ravi Bhaskar (JIRA)
When using hibernate-search3.1.0 GA, Search throws AlreadyClosedException under certain circumstances
-----------------------------------------------------------------------------------------------------
Key: HSEARCH-362
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-362
Project: Hibernate Search
Issue Type: Bug
Components: directory provider
Affects Versions: 3.1.0.GA
Environment: Hibernate 3.2.6 GA, ant 1.7.1
Reporter: S Ravi Bhaskar
The below code throws an AlreadyClosedException when trying to open the lucene index. Junit test to test it works from eclipse, fails in an ant build.
I suspect it is trying to reuse a handle to the index. Please let me know if you need more information.
I had to bump back my hibernate search version to 3.0.1 GA, and then it started working. I am getting by, but would ideally like to use 3.1.0 GA without this exception. I think it has something to do with Search.getFullTextEntityManager((getJpaPersistenceContext().getEntityManager())); VS Search.createFullTextEntityManager((getJpaPersistenceContext().getEntityManager())); in the older version.
String query = "BlahBlahBlah";
org.apache.lucene.queryParser.QueryParser parser = new QueryParser("ItemTitle", new StandardAnalyzer() );
org.apache.lucene.search.Query luceneQuery;
try {
luceneQuery = parser.parse(query);
} catch (ParseException e) {
// TODO Auto-generated catch block
logger.error(String.format("Error parsing search querystring "));
return null;
}
javax.persistence.Query fullTextQuery = createFullTextEntityManager().createFullTextQuery(luceneQuery, klass);
List result = fullTextQuery.getResultList(); // return a list of managed
where createFullTextEntityManager() is
public FullTextEntityManager createFullTextEntityManager() {
return Search.getFullTextEntityManager((getJpaPersistenceContext().getEntityManager()));
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-396) disableFullTextFilter(String name) in FullTextQueryImpl does not disable the filter.
by wolfjourn (JIRA)
disableFullTextFilter(String name) in FullTextQueryImpl does not disable the filter.
------------------------------------------------------------------------------------
Key: HSEARCH-396
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-396
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.1.1.GA
Environment: Hibernate 3.3.2.GA
Hibernate Annotations 3.4.0.GA
RDBMS: MySQL, version: 5.0.70-log
JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.6
Reporter: wolfjourn
The disableFullTextFilter(String name) method in FullTextQueryImpl does not cause the filter to be disabled. This is due to incorrect logic in the buildFilters() method in the same class.
For example,
fullTextQuery = s.createFullTextQuery( query, Driver.class );
fullTextQuery.list().size(); /* Returns 10 */
fullTextQuery.enableFullTextFilter("security");
fullTextQuery.list().size(); /* Returns 5 */
fullTextQuery.disableFullTextFilter("security");
fullTextQuery.list().size(); /* Returns 5. Should return 10. */
Initially, buildFilters() constructs `filter' using the "security" filter from filterDefinitions. During the disableFullTextFilter("security") call, the filter is removed from `filterDefinitions'. However, `filter' remains intact. The subsequent call to buildFilters() returns immediately as `filterDefinitions' is now empty, leaving `filter' intact and thus not disabling the "security" filter. Furthermore, if a filter is disabled and replaced with another filter, the result will be a composition of both filters as towards the bottom of buildFilters(), any existing `filter' is chained onto the end of a new `chainedFilter'. This results in an empty result set if the sets returned by the filters are mutually exclusive.
It looks like this issue was resolved with revision 16755. However, this is still worth documenting here for other 3.1.1.GA users that might run into the same issue.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-389) Filtering using criteria API is unreliable
by Dirk Mahler (JIRA)
Filtering using criteria API is unreliable
------------------------------------------
Key: HSEARCH-389
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-389
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.1.1.GA, 3.1.0.GA
Environment: Hibernate 3.3.2.GA, Hibernate Entity Manager 3.4.0.GA, Oracle 9.2
Reporter: Dirk Mahler
Within one EntityManager session the following use case leads to wrong results if using Hibernate Search in combination with the Criteria API:
1. Execute a simple query which returns Entity A and B as results
2. Doing a full text query which will find A and B but restricts the results to A by doing a further filtering for an attribute which is only satisfied by A using the criteria API.
Hibernate Search returns both A and B. After looking at the source code the reason seems to be the follwoing:
- the full text search returns a list of entities
- the Criteria query is simply used to initialize the entities within the EntityManager's session, the result set/list itself is ignored, see ObjectLoaderHelper#initializeObjects(EntityInfo[] entityInfos, Criteria criteria, Class<?> entityType, SearchFactoryImplementor searchFactoryImplementor):
...
criteria.add( disjunction );
criteria.list(); //load all objects <-- ???
}
- the result is now determined by checking wether the entities from the full text search are initialized using Hibernate.isInitalized(), see QueryLoader#load(EntityInfo... entityInfos and returnAlreadyLoadedObjectsInCorrectOrder(EntityInfo[] entityInfos, Session session))
This approach is highly fragile because it relies on side effects and should be discarded in favor of using the result of the criteria query which already represents the expected result. Is there any good reason to ignore it?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-399) NPE in org.hibernate.search.backend.WorkQueue.clear()
by Dobes Vandermeer (JIRA)
NPE in org.hibernate.search.backend.WorkQueue.clear()
-----------------------------------------------------
Key: HSEARCH-399
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-399
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA
Reporter: Dobes Vandermeer
Our server blew up, and we're seeing a continuous stream of:
[#|2009-09-17T06:24:02.169-0700|SEVERE|sun-appserver9.1|books.db.search.SafeBatchedQueueingProcessor|_ThreadID=40;_Threa
dName=httpSSLWorkerThread-8080-19;_RequestID=97e3df6c-2fc7-4f54-a47a-e77ba48d1a07;|RuntimeException during cancelWorks()
java.lang.NullPointerException
at org.hibernate.search.backend.WorkQueue.clear(WorkQueue.java:58)
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.cancelWorks(BatchedQueueingProcessor.java:180)
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.afterCompletion(PostTransactionWorkQueueSynchronization.java:56)
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:491)
The method body for this is:
public void clear() {
queue.clear(); // <---- queue is null
if (sealedQueue != null) sealedQueue.clear();
}
It appears that queue may be set null by the setSealedQueue method above:
public void setSealedQueue(List<LuceneWork> sealedQueue) {
//invalidate the working queue for serializability
queue = null;
this.sealedQueue = sealedQueue;
}
The only change I've made recently that I thought could cause this was to change the search system to run in a separate thread. My hibernate search options are:
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.bytecode.provider" value="javassist"/>
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider"/>
<property name="hibernate.search.default.indexBase" value="../search-indexes"/>
<property name="hibernate.search.worker.scope" value="books.db.search.SafeWorkerImpl"/>
<property name="hibernate.search.worker.backend" value="books.db.search.SafeBackendQueueProcessorFactory"/>
<property name="hibernate.search.worker.execution" value="async"/> <!-- sync or async -->
<property name="hibernate.search.worker.buffer_queue.max" value="5"/>
<property name="hibernate.search.worker.thread_pool.size" value="5"/>
</properties>
Note that books.db.search.Safe* are classes I wrote that wrap the default implementation with an exception handler; sometimes RuntimeExceptions were thrown and glassfish would just silently eat them and fail, now they are noisily eaten and the transaction commits anyway.
This was probably (to some degree) triggered by the exception logged just prior:
[#|2009-09-17T06:23:56.498-0700|SEVERE|sun-appserver9.1|org.hibernate.event.def.AbstractFlushingEventListener|_ThreadID=40;_ThreadName=httpSSLWorkerThread-8080-19;_RequestID=97e3df6c-2fc7-4f54-a47a-e77ba48d1a07;|Could not synchronize database state with session
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [books.db.Business#5617057]
at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1782)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:419)
Figuring out under which conditions the queue became null but shouldn't have been might be nearly impossible at this point, although I'll watch out for repeats of this issue.
The NPE itself might be easier to fix, if you just check for null before calling clear().
For now I'll try implementing a workaround in my safe subclass like this:
@Override
public void cancelWorks(WorkQueue workQueue) {
try {
super.cancelWorks(workQueue);
} catch (RuntimeException e) {
logger.error("RuntimeException during cancelWorks()", e);
try {
if(workQueue.getQueue() != null)
workQueue.getQueue().clear();
else
workQueue.getSealedQueue().clear();
} catch(org.hibernate.annotations.common.AssertionFailure t) {
// sealedQueue was null too
}
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-462) Indexes are not getting updated when entity gets updated via hql.
by shareef shaik (JIRA)
Indexes are not getting updated when entity gets updated via hql.
-----------------------------------------------------------------
Key: HSEARCH-462
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-462
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA
Environment: Hibernate 3.3, H-Search 3.1.1 GA, Hiberante Annotations, Oracle DB, FSDirectoryProvider
Reporter: shareef shaik
We are using Hibernate Annotations and Hibernate Search, and to my understanding there is no need to write listeners to update/delete index on update/delete of an entity. I tried updating an entity via hql update, and also via persisting the entity and making changes in it. In the second scenario, the index is getting updated, but in the first scenario it is not. I checked for the changes in db and in both scenarios, the changes are reflected in db. A simple test case for the same.
Case 1:
--------
String hql = "update UserMaster umst set umst.userName = :uName where umst.userId = :uId";
org.hibernate.Query query = getSession().createQuery(hql);
query.setParameter("uName","ABM1");
query.setParameter("uId",1001L);
query.executeUpdate();
Case 2:
--------
UserMaster master = (UserMaster)getSession().get(UserMaster.class,1001L);
master.setUserName("ABM1");
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-466) separating annotations from core as own jar
by Vadim Bauer (JIRA)
separating annotations from core as own jar
-------------------------------------------
Key: HSEARCH-466
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-466
Project: Hibernate Search
Issue Type: Improvement
Components: build
Affects Versions: 3.2.0.Beta1, 3.1.1.GA, 3.1.0.GA, 3.1.0.CR1, 3.1.0.Beta2, 3.1.0.Beta1, 3.1.2, 3.2.0.CR1, 3.3.0
Environment: not important
Reporter: Vadim Bauer
Why not separating the hibernate search annotations from HS core?
e.g.
hibernate-search-core.jar
hibernate-search-annotations.jar
It is quite cumbersome if you in a fat clients or RCPs environment and want share the same domain model with your client. The client needs to have lucene, hibernate search and hibernate stuff even thou he never uses it except a few annotations.
If it is ok I would like contribute my changes to the community.
Best regards
Vadim
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-492) FSMasterDirectoryProvider and FSSlaveDirectoryProvider don't shutdown the Executor
by Sylvain Charton (JIRA)
FSMasterDirectoryProvider and FSSlaveDirectoryProvider don't shutdown the Executor
----------------------------------------------------------------------------------
Key: HSEARCH-492
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-492
Project: Hibernate Search
Issue Type: Bug
Components: directory provider
Affects Versions: 3.1.1.GA
Environment: Java 1.6.0
Reporter: Sylvain Charton
Priority: Minor
I'm using Hibernate Search clustering feature in a stand alone Java application (not a webapp).
My problem is the application never stops: many threads are still living.
Both FSMasterDirectoryProvider and FSSlaveDirectoryProvider use a Single Thread Executor to perform the CopyTask.
When the FSSlaveDirectoryProvider.stop() is called, the timer is stopped, but not the Executor in the TimerTask.
Consequence is the process can't stop, because some threads are still living, endlessly.
This happens after the first CopyDirectory task was executed.
My fix was to copy this class in my code, and replace the Executor in TriggerTask class by an ExecutorService in FSSlaveDirectoryProvider class.
The ExecutorService is initialized in the start() method:
{code:Java}this.executor = Executors.newSingleThreadExecutor() ;{code}
And properly shut down in the stop() method:
{code:java}
executor.shutdown();
boolean terminated = false ;
try{
terminated = executor.awaitTermination(20, TimeUnit.SECONDS);
} catch (InterruptedException e1) {
terminated = false ;
}
if (!terminated) {
executor.shutdownNow() ;
}
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-460) LazyInitializationException while removing entity with @ContainedIn annotation
by Maciej Szulik (JIRA)
LazyInitializationException while removing entity with @ContainedIn annotation
------------------------------------------------------------------------------
Key: HSEARCH-460
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-460
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.1.1.GA
Reporter: Maciej Szulik
Priority: Blocker
Attachments: hibsearch.zip, Lazy.stack
I attach a Jboss Seam 2.2.0.GA project (without lib directory - one should take it entirely from seam default application generated using seam gen), as a complete illustration of the problem.
The Problem itself:
I have 2 entities:
Color (Long id, String name, Set<Vehicle> vehicles)
and Vehicle (Long id, String name, Color color).
Vehicle is indexed entity (@Indexed), while color has @ContainedIn on Set<Vehicle>.
Problem arises while managing color objects, strictly speaking while removing colors, LazyInitalizationException is thrown (stack trace is in attachment).
Every other operation on color entity (inserting, updating) works like a charm.
In attached example I created with a simple page for managing colors. It presents a list of already defined color objects in DB. If non present, you should generate some with 'Add random color'. To obtain above error click on 'Remove' link next to one of the colors presented on list.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-5080) NPE when determining types of named parameters
by John Aylward (JIRA)
NPE when determining types of named parameters
----------------------------------------------
Key: HHH-5080
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5080
Project: Hibernate Core
Issue Type: Bug
Components: core, query-hql
Affects Versions: 3.5.0-Final
Environment: sun java 6.0.19 runtime, hibernate 3.5.0-final using annotations, mysql 5.0.75-0ubuntu10.3
Reporter: John Aylward
Attachments: hibernateLog.txt
Attached is the relevant hibernate log with the offending query.
Relevant stack trace:
java.lang.NullPointerException
at org.hibernate.hql.ast.ParameterTranslationsImpl.getNamedParameterExpectedType(ParameterTranslationsImpl.java:87)
at org.hibernate.engine.query.HQLQueryPlan.buildParameterMetadata(HQLQueryPlan.java:320)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:121)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1760)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Commented: (HHH-1804) Empty 'FetchingScrollableResultsImpl' throws SQLException
by Andreas Sahlbach (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804?page=c... ]
Andreas Sahlbach commented on HHH-1804:
---------------------------------------
Could someone PLEASE fix this bug? It's now nearly 4 years old, there is a test case and a patch that seems to work and it is still _very_ annoying. The only workaround is to catch the exception and parse the message to distinguish it from other exceptions. It really sucks to be forced to use such a workaround. And the patch is not very complicated...
> Empty 'FetchingScrollableResultsImpl' throws SQLException
> ---------------------------------------------------------
>
> Key: HHH-1804
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1804
> Project: Hibernate Core
> Issue Type: Bug
> Reporter: Maarten Winkels
> Attachments: EmptyFetchJoinScrollTest.java, scroll-join-fetch-empty.patch
>
>
> When scrolling a HQL query with join fetch on a collection, that doesn't return any results, the following execption occurs:
> org.hibernate.exception.GenericJDBCException: could not perform sequential read of results (forward)
> at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
> at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
> at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:386)
> at org.hibernate.impl.FetchingScrollableResultsImpl.next(FetchingScrollableResultsImpl.java:55)
> at org.hibernate.test.joinfetch.EmptyFetchJoinScrollTest.testFetchJoinEmptyScroll(EmptyFetchJoinScrollTest.java:21)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at org.hibernate.test.TestCase.runTest(TestCase.java:161)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
> Caused by: java.sql.SQLException: No data is available
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.checkAvailable(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getColumnInType(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hsqldb.jdbc.jdbcResultSet.getString(Unknown Source)
> at org.hibernate.type.StringType.get(StringType.java:18)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:113)
> at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:102)
> at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1088)
> at org.hibernate.loader.Loader.loadSequentialRowsForward(Loader.java:375)
> ... 18 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-385) Lazy ManyToOne association with @containedIn annotation cause HSearch create entity index with documentId = 0
by Grégoire Rolland (JIRA)
Lazy ManyToOne association with @containedIn annotation cause HSearch create entity index with documentId = 0
-------------------------------------------------------------------------------------------------------------
Key: HSEARCH-385
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-385
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA, 3.1.0.GA
Environment: Hibernate 3.3.1.GA, Postgresql 8.3
Reporter: Grégoire Rolland
Priority: Critical
Attachments: hsearch.tar.gz
In a transaction, create Entity1 associated to one Entity2 (E1->E2 lazy oneToMany, E2->E1 lazy manyToOne).
In antoher transaction, find Entity2, modify Entity2.
On commit, I get this log :
2009-07-02 11:42:18,791 TRACE [org.hibernate.search.backend.impl.lucene.works.DeleteExtWorkDelegate] - Removing class org.foo.hibernate.search.jira.Entity1#0 by id using an IndexWriter.
2009-07-02 11:42:18,792 TRACE [org.hibernate.search.backend.impl.lucene.works.AddWorkDelegate] - add to Lucene index: class org.foo.hibernate.search.jira.Entity1#0:Document<stored/uncompressed,indexed<_hibernate_class:org.foo.hibernate.search.jira.Entity1> stored/uncompressed,indexed<uid:0> stored/uncompressed,indexed<entities2.uid:224136060>>
in the index :
1 document for Entity, with the correct Id, and 1 document with Id = 0, index is corrupted.
See the test case for more info.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-5075) Storing @NotAudit column in _AUD tables
by Stephanie Pau (JIRA)
Storing @NotAudit column in _AUD tables
----------------------------------------
Key: HHH-5075
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5075
Project: Hibernate Core
Issue Type: Bug
Components: envers
Reporter: Stephanie Pau
Priority: Minor
When @Audited is not applied to a property, the property change does not trigger an audited row to be recorded. This is desirable. But at the same time, this property is missing from the audited table altogether. Is there a way for me to tell Enver to keep the column but just dont trigger an audit on this property change?
For example, ObjectOne has properties: id, column1(@audited), column2(not audited).
When column1 changes, audit row is created for ObjectOne will be id, REV, column1, *column2*
When column2 changes, audit row is not created.
The reason for this is because column1 is business critical field, every change is important. column2 is a much faster changing field than column1, but is not that business critical, none the less, it is still useful to have a rough (sampled at the rate of column1 change) history of column2.
http://community.jboss.org/message/535808#535808
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-5076) Multiple failures reported during ReadOnlyProxyTest with Ingres
by Ray Fan (JIRA)
Multiple failures reported during ReadOnlyProxyTest with Ingres
---------------------------------------------------------------
Key: HHH-5076
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5076
Project: Hibernate Core
Issue Type: Patch
Components: testsuite
Affects Versions: 3.5.0-Final
Environment: Hibernate 3.5.0-Final, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Priority: Minor
Attachments: DataPoint.hbm.xml.svn.diff
Failures reported from org.hibernate.test.readonly.ReadOnlyProxyTest in the following tests:
{noformat}
testReadOnlyViaSessionDoesNotInit
testReadOnlyViaLazyInitializerDoesNotInit
testReadOnlyViaSessionNoChangeAfterInit
testReadOnlyViaLazyInitializerNoChangeAfterInit
testReadOnlyViaSessionBeforeInit
testModifiableViaSessionBeforeInit
testReadOnlyViaSessionBeforeInitByModifiableQuery
testReadOnlyViaSessionBeforeInitByReadOnlyQuery
testModifiableViaSessionBeforeInitByModifiableQuery
testModifiableViaSessionBeforeInitByReadOnlyQuery
testReadOnlyViaLazyInitializerBeforeInit
testModifiableViaLazyInitializerBeforeInit
testReadOnlyViaLazyInitializerAfterInit
testModifiableViaLazyInitializerAfterInit
testReadOnlyChangedEvictedUpdate
testReadOnlyToModifiableInitWhenModifiedIsUpdated
testReadOnlyInitToModifiableModifiedIsUpdated
testReadOnlyModifiedUpdate
testReadOnlyProxyMergeDetachedProxyWithChange
testReadOnlyProxyInitMergeDetachedProxyWithChange
testReadOnlyProxyMergeDetachedEntityWithChange
testReadOnlyProxyInitMergeDetachedEntityWithChange
testReadOnlyEntityMergeDetachedProxyWithChange
testSetReadOnlyInTwoTransactionsSameSession
testSetReadOnlyBetweenTwoTransactionsSameSession
testSetModifiableBetweenTwoTransactionsSameSession
{noformat}
All fail because of an assertion expected:<0.1000000000000000055> but was:<0.10000000000000000550> when run with Ingres 9.3.
The DataPoint.hbm.xml description for X and Y specify precision 25 and scale 20 creating the equivalent decimal(25,20) in the Ingres table and returning a zero padded decimal value.
Adjusted the scale in the mapping to match expected.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-495) IdentifierProducer: ClassCastException
by Marco Pirruccio (JIRA)
IdentifierProducer: ClassCastException
--------------------------------------
Key: HSEARCH-495
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-495
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.2.0.Beta1
Environment: hibernate-core-3.5.0-Beta-2.jar, hibernate-commons-annotations-3.2.0.Beta1.jar, hibernate-search-3.2.0.Beta1.jar, jtds-1.2.5.jar (SQL Server 2008), Java 6
Reporter: Marco Pirruccio
Priority: Blocker
Executing the following code:
FullTextSession s = Search.getFullTextSession(session);
MassIndexer mi = s.createIndexer();
mi.optimizeOnFinish(true);
mi.batchSizeToLoadObjects(10);
mi.startAndWait();
I obtain the following exception:
Exception in thread "Hibernate Search: identifierloader-1" java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
at org.hibernate.search.batchindexing.IdentifierProducer.loadAllIdentifiers(IdentifierProducer.java:114)
at org.hibernate.search.batchindexing.IdentifierProducer.inTransactionWrapper(IdentifierProducer.java:103)
at org.hibernate.search.batchindexing.IdentifierProducer.run(IdentifierProducer.java:91)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The executed query is:
select
count(this_.idfornitore) as y0_
from
fornitore this_
The method loadAllIdentifiers() does the following cast:
Long totalCount = (Long) session
.createCriteria( indexedType )
.setProjection( Projections.count( "id" ) )
.setCacheable( false )
.uniqueResult();
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-5074) Criteria query using AliasToBeanResultTransformer fails with 3.5-Final
by Florian Grote (JIRA)
Criteria query using AliasToBeanResultTransformer fails with 3.5-Final
----------------------------------------------------------------------
Key: HHH-5074
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5074
Project: Hibernate Core
Issue Type: Bug
Components: core, query-criteria, query-sql
Affects Versions: 3.5.0-Final
Environment: Hibernate 3.5-Final,
Database: MySQL 5.1.45 GA,
JDBC: mysql-connector-java-5.1.12
Reporter: Florian Grote
I use the following Criteria query to receive the top ten users for an attribute "scoreSum". Attribute "statistic" is an embedded child (@Embeddable) of "User" entity.
The result is written directly into a value object using AliasToBeanResultTransformer.
{code:title=Criteria query|borderStyle=solid}
@SuppressWarnings("unchecked")
@Override
public List<TopUserVO> getTopUsersAsVO(int max) {
return getCurrentSession().createCriteria(User.class)
.setProjection(Projections.projectionList()
.add( Projections.property("username"), "username" )
.add( Projections.property("statistic.scoreSum"), "scores" )
)
.addOrder(Property.forName("statistic.scoreSum").desc())
.setMaxResults(max)
.setResultTransformer( new AliasToBeanResultTransformer(TopUserVO.class) )
.list();
}
{code}
Until inclusive Hibernate version 3.5-CR2 this runs fine and results in the valid (My-)SQL query:
{quote}
select
this_.USERNAME as y0_,
this_.SCORE_SUM as y1_
from USER this_
order by this_.SCORE_SUM desc limit ?
{quote}
After upgrading to Hibernate version 3.5-final the same query fails because SQL query is not created correctly anymore. Corrupted SQL:
{quote}
select
{color:red}*y0_ as y0_,*{color}
this_.SCORE_SUM as y1_
from USER this_
order by this_.SCORE_SUM desc
{quote}
Problem is that "y0_" is used twice, instead of using it only as alias: "this_.USERNAME as y0_".
Here is the relevant part of the root stacktrace:
{code:title=Root Exception}
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'y0_' in 'field list'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3562)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3494)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2105)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2264)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1849)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.doList(Loader.java:2294)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2172)
at org.hibernate.loader.Loader.list(Loader.java:2167)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:119)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1706)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:347)
at xyz.dao.UserDaoImpl.getTopUsersAsVO(UserDaoImpl.java:95)
{code}
I will try to research the new Hibernate code and the difference to the old one and try to provide a patch.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-4784) JDBCTransaction -> commit() -> notifyLocalSynchsBeforeTransactionCompletion()
by Silvan Eugen Lincan (JIRA)
JDBCTransaction -> commit() -> notifyLocalSynchsBeforeTransactionCompletion()
-----------------------------------------------------------------------------
Key: HHH-4784
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4784
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-2
Environment: hibernate-distribution-3.5.0-Beta-2
ms-sqlserver 2008
Reporter: Silvan Eugen Lincan
Java class: org.hibernate.transaction.JDBCTransaction
method: commit()
line: 140 call to notifyLocalSynchsBeforeTransactionCompletion()
The problem is this: method notifyLocalSynchsBeforeTransactionCompletion(), it swallows any exception that may occur at this level and permits the execution flow of commit() method to continue.
But in this case, the hibernate session may be already corrupted, so the commit will be wrong.
In my opinion, the method notifyLocalSynchsBeforeTransactionCompletion() should throw the exception, and on line 140 in commit() method, the call to this notifyLocalSynchsBeforeTransactionCompletion() should be surrounded also in the try{}catch(){}.
Otherwise, any error that can occur on Synchronization, will be omitted and the transaction committed(it should be rolled back).
I had this problem, executing the tests from envers module with the ms sqlserver 2008 database.
The test org.hibernate.envers.test.integration.reventity.ExceptionListener crashes.
I hope that it deserves your attention.
Thank you very much.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-3449) Unable to use Oracle stored procedure in a <sql-query>
by RC (JIRA)
Unable to use Oracle stored procedure in a <sql-query>
------------------------------------------------------
Key: HHH-3449
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3449
Project: Hibernate3
Issue Type: Bug
Components: query-sql
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6GA
Oracle 10.2.0.4 (& Oracle JDBC Driver version - 11.1.0.6.0)
Java 1.6.0_06
Reporter: RC
Using a stored procedure to fetch result set.
However, an IllegalAccessException is thrown:
Caused by: org.hibernate.HibernateException: Problem while trying to load or access OracleTypes.CURSOR value
at org.hibernate.dialect.Oracle8iDialect.registerResultSetOutParameter(Oracle8iDialect.java:371)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1560)
at org.hibernate.loader.Loader.doQuery(Loader.java:673)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2213)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:152)
at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
....
Caused by: java.lang.IllegalAccessException: Class org.hibernate.dialect.Oracle8iDialect can not access a member of class oracle.jdbc.driver.OracleTypes with modifiers ""
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
at java.lang.Class.newInstance0(Class.java:349)
at java.lang.Class.newInstance(Class.java:308)
at org.hibernate.dialect.Oracle8iDialect.registerResultSetOutParameter(Oracle8iDialect.java:369)
... 35 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-4960) org.hibernate.test.hql.ASTParserLoadingTest error running testJpaTypeOperator test with Ingres
by Ray Fan (JIRA)
org.hibernate.test.hql.ASTParserLoadingTest error running testJpaTypeOperator test with Ingres
----------------------------------------------------------------------------------------------
Key: HHH-4960
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4960
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Attachments: hql-astparserloadingtest.zip
org.hibernate.test.hql.ASTParserLoadingTest testJpaTypeOperator reports an error executing the test with an Ingres exception
{noformat}
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2257)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:448)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.test.hql.ASTParserLoadingTest.testJpaTypeOperator(ASTParserLoadingTest.java:121)
Caused by: com.ingres.gcf.util.SqlEx: line 1, There is no such function as 'type'.
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.DrvPrep.prepare(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.createPrepStmt(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.createPrep(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.prepareStatement(Unknown Source)
{noformat}
The test source code {{s.createQuery( "from Animal a where type(a) = Dog" ).list();}} invokes the 'type' function as part of the SQL WHERE clause.
The function 'type' is not one that is supported by Ingres.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-478) Hibernate Search : MySQL Primary Key Composed -> No use DB index on select
by Gaël Saunier (JIRA)
Hibernate Search : MySQL Primary Key Composed -> No use DB index on select
--------------------------------------------------------------------------
Key: HSEARCH-478
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-478
Project: Hibernate Search
Issue Type: Bug
Components: optimizer
Affects Versions: 3.1.0.GA
Environment:
Eclipse SDK - Version: 3.3.2
MySql - 5.1.44-community
Hibernate Search - 3.1.0.GA
hibernate-entitymanager - 3.4.0.GA
hibernate-annotations - 3.4.0.GA
hibernate-core - 3.3.2.GA
Show »
Eclipse SDK - Version: 3.3.2
MySql - 5.1.44-community
Hibernate Search - 3.1.0.GA
hibernate-entitymanager - 3.4.0.GA
hibernate-annotations - 3.4.0.GA
hibernate-core - 3.3.2.GA
Reporter: Gaël Saunier
Request with In Clause and primary key composed have a bug.
MySQL couldn't use existing index when request :
Select *
>From xxx
where (y1,y2,y3) in ((v11,v12,v13),(v21,v22,v23),(v31,v32,v33))
y1,y2,y3 is composed primary key.
when i request :
Select *
>From xxx
where (y1,y2,y3) in ((v11,v12,v13))
it's ok same as :
Select *
>From xxx
where (y1,y2,y3) = (v11,v12,v13)
or (y1,y2,y3) = (v21,v22,v23)
or (y1,y2,y3) = (v31,v32,v33)
Hibernate Search use IN clause to select entity :
select this_ (.....xx....) from Demande this_ where ((this_.RDES, this_.TYPE_DEM, this_.UI_PHAR) in ((?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?), (?, ?, ?)))
I see just one solution to workaround.
It's ok for Oracle and PostgreSQL, i tested it.
To workaround, we have to make select with OR in where clause :
select .....
>From .....
where (x1,x2,x3) = (v11,v12,v13)
OR (x1,x2,x3) = (v21,v22,v23)
OR (x1,x2,x3) = (v31,v32,v33)
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-4961) org.hibernate.test.hql.ASTParserLoadingTest error running testPaginationWithPolymorphicQuery with Ingres
by Ray Fan (JIRA)
org.hibernate.test.hql.ASTParserLoadingTest error running testPaginationWithPolymorphicQuery with Ingres
---------------------------------------------------------------------------------------------------------
Key: HHH-4961
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4961
Project: Hibernate Core
Issue Type: Bug
Components: testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Attachments: hql-astparserloadingtest.zip
org.hibernate.test.hql.ASTParserLoadingTest testPaginationWithPolymorphicQuery reports an error executing the test with an Ingres exception
{noformat}
<error message="could not execute query" type="org.hibernate.exception.SQLGrammarException">org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2257)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2151)
at org.hibernate.loader.Loader.list(Loader.java:2146)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:448)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.hibernate.test.hql.ASTParserLoadingTest.testPaginationWithPolymorphicQuery(ASTParserLoadingTest.java:249)
Caused by: com.ingres.gcf.util.SqlEx: A <column reference> contained a <qualifier> 'product0_'
which did not correspond to any of the <table reference>s
within whose scope the <column reference> appeared.
at com.ingres.gcf.jdbc.DrvObj.readError(Unknown Source)
at com.ingres.gcf.jdbc.DrvObj.readResults(Unknown Source)
at com.ingres.gcf.jdbc.DrvPrep.prepare(Unknown Source)
at com.ingres.gcf.jdbc.DrvConn.createPrepStmt(Unknown Source)
at com.ingres.gcf.jdbc.JdbcPrep.<init>(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.createPrep(Unknown Source)
at com.ingres.gcf.jdbc.JdbcConn.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1597)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:271)
at org.hibernate.loader.Loader.doList(Loader.java:2254)
... 38 more
</error>
{noformat}
The SQL query that is produced references product0_ in the WHERE clause of the subselect.
{noformat}
select
product0_.productId as productId37_,
product0_.description as descript2_37_,
product0_.cost as cost37_,
product0_.numberAvailable as numberAv4_37_,
( select
sum(li.quantity)
from
LineItem li
where
li.productId = product0_.productId ) as formula2_
from
Product product0_
{noformat}
Ingres does not support this scoping in 9.3.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-5071) Updates/Inserts not being seen by apps sharing same dbPosted: Mon Apr 05, 2010 7:56 am
by Kevin Orey (JIRA)
Updates/Inserts not being seen by apps sharing same dbPosted: Mon Apr 05, 2010 7:56 am
---------------------------------------------------------------------------------------
Key: HHH-5071
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5071
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.1
Environment: hibernate: 3.3.1
Server version: 5.0.66sp1-enterprise-gpl-log MySQL Enterprise Server (GPL)
Reporter: Kevin Orey
Priority: Blocker
Attachments: junit.java
I am having a problem where I have application A running in a JVM (no application server) and have application B running in a JVM (no application server). Application A selects from table Y every 10 seconds checking for new rows. Application B places records into table Y. Application A never picks up the new rows. If I start and stop Application A then he picks up the new rows. I have tried turning off first and second level query caching as well as turning of caching all together. I should also mention that I am using Hibernate as my implementation of JPA. I am not using a hibernate cfg but I am using a Persistence.xml. I am running under JDK 1.6. Any help is much appreciated.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-5045) org.hibernate.test.hql.HQLTest failure running testConcatenation with Ingres
by Ray Fan (JIRA)
org.hibernate.test.hql.HQLTest failure running testConcatenation with Ingres
----------------------------------------------------------------------------
Key: HHH-5045
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5045
Project: Hibernate Core
Issue Type: Bug
Components: core, testsuite
Affects Versions: 3.5.0-CR-2
Environment: Hibernate 3.5.0-CR-2, Ingres 9.3.1 (int.lnx/106), Ingres9Dialect
Reporter: Ray Fan
Priority: Minor
Assertion failure in testConcatenate:
{noformat}
<failure message="SQL is not the same as the old SQL (scalar=true) expected:<...(lower(upper('foo')||upper(?))like 'f%' )> but was:<...lower((upper('foo')+upper(?))) like 'f%'>" type="junit.framework.ComparisonFailure">junit.framework.ComparisonFailure: SQL is not the same as the old SQL (scalar=true) expected:<...(lower(upper('foo')||upper(?))like 'f%' )> but was:<...lower((upper('foo')+upper(?))) like 'f%'>
at junit.framework.Assert.assertEquals(Assert.java:81)
at org.hibernate.test.hql.QueryTranslatorTestCase.assertSQLEquals(QueryTranslatorTestCase.java:315)
at org.hibernate.test.hql.QueryTranslatorTestCase.checkSql(QueryTranslatorTestCase.java:304)
at org.hibernate.test.hql.QueryTranslatorTestCase.assertTranslation(QueryTranslatorTestCase.java:194)
at org.hibernate.test.hql.QueryTranslatorTestCase.assertTranslation(QueryTranslatorTestCase.java:120)
at org.hibernate.test.hql.QueryTranslatorTestCase.assertTranslation(QueryTranslatorTestCase.java:102)
at org.hibernate.test.hql.HQLTest.testExpressionWithParamInFunction(HQLTest.java:241)
</failure>
{noformat}
The character used as the concatenation operator is specified as '+' in the IngresDialect although Ingres supports both '+' and "||".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months
[Hibernate-JIRA] Created: (HHH-3395) Oracle LONG datatype fetching fails on superclass Criteria query
by Ville Anttonen (JIRA)
Oracle LONG datatype fetching fails on superclass Criteria query
----------------------------------------------------------------
Key: HHH-3395
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3395
Project: Hibernate3
Issue Type: Bug
Environment: Oracle 10
Windows XP
Hibernate 3
Weblogic 9.2
Reporter: Ville Anttonen
I have dao-layer method like this.
public PersistentQuery getPersistentQuery(String userId, long queryId){
....
Criteria criteria = m_session.createCriteria(PersistentQuery.class);
criteria.add(Expression.eq("userId",userId));
criteria.add(Expression.eq("id",new Long(queryId)));
return (PersistentQuery) criteria.uniqueResult();
.....
}
Previous code throws "Stream already closed" exception.
PersistentQuery is abstract class
and it's subclasses contains UserType - field
that wraps Oracle's long varchar field.
I can fix this by creating criteria by subclass
like " Criteria criteria = m_session.createCriteria(PersistentOrganizationQuery.class); ".
We're migrating from ingres -> oracle and in ingres previous implementation worked fine.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 3 months