[Hibernate-JIRA] Created: (HHH-5844) SQLServer 2008 and latest Microsoft JDBC jar causes exception
by guy bashan (JIRA)
SQLServer 2008 and latest Microsoft JDBC jar causes exception
-------------------------------------------------------------
Key: HHH-5844
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5844
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.0
Reporter: guy bashan
Attachments: sqljdbc4.jar
I am working with SQL Server 2008.
I just upgraded to the Microsoft latest JDBC driver: sqljdbc4.jar
I am getting this exception:
org.hibernate.MappingException: No Dialect mapping for JDBC type: -9
org.hibernate.dialect.TypeNames.get(TypeNames.java:78)
org.hibernate.dialect.TypeNames.get(TypeNames.java:103)
org.hibernate.dialect.Dialect.getHibernateTypeName(Dialect.java:328)
org.hibernate.loader.custom.CustomLoader$Metadata.getHibernateType(CustomLoader.java:590)
org.hibernate.loader.custom.CustomLoader$ScalarResultColumnProcessor.performDiscovery(CustomLoader.java:516)
org.hibernate.loader.custom.CustomLoader.autoDiscoverTypes(CustomLoader.java:532)
org.hibernate.loader.Loader.getResultSet(Loader.java:1962)
org.hibernate.loader.Loader.doQuery(Loader.java:802)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
org.hibernate.loader.Loader.doList(Loader.java:2533)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
org.hibernate.loader.Loader.list(Loader.java:2271)
org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1842)
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:157)
com.todacell.ui.model.dao.CampaignDAO.getNetworkCampaigns(CampaignDAO.java:86)
com.todacell.ui.view.bean.campaign.CampaignBrowseListBean$Model.getCampaigns(CampaignBrowseListBean.java:141)
com.todacell.ui.view.bean.campaign.CampaignBrowseListBean$Model.fetchPage(CampaignBrowseListBean.java:91)
com.anydoby.jsfpager.PagedListDataModel.fetchPageInternal(PagedListDataModel.java:152)
com.anydoby.jsfpager.PagedListDataModel.getPage(PagedListDataModel.java:100)
com.anydoby.jsfpager.PagedListDataModel.getWrappedData(PagedListDataModel.java:161)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:140)
org.apache.el.parser.AstValue.getValue(AstValue.java:118)
org.apache.el.parser.AstEmpty.getValue(AstEmpty.java:45)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
javax.faces.component._ComponentUtils.getExpressionValue(_ComponentUtils.java:236)
javax.faces.component.UIComponentBase.getExpressionValue(UIComponentBase.java:1176)
javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:1251)
org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:276)
org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:611)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:250)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:257)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.actuallyRenderView(JspViewHandlerImpl.java:427)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:383)
org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:155)
org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
com.todacell.ui.view.filter.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:105)
com.todacell.ui.view.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:61)
--
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
13 years, 4 months
[Hibernate-JIRA] Created: (HHH-3051) NPE while query.list on a Native SQL, using L2 cache
by Amit Kapoor (JIRA)
NPE while query.list on a Native SQL, using L2 cache
----------------------------------------------------
Key: HHH-3051
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3051
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: Hibernate 3.2.5ga
Database Oracle 9i
Jdk - 1.4.2_13
EHCache 1.2.3 / OsCache 2.1 both
Reporter: Amit Kapoor
I get an NPE when i try to execute a native query.
Below is the excerpt of the code that throws NPE:
String sqlQuery = "select emp_id, emp_first_name from employee_mt";
SQLQuery query = session.createSQLQuery(sqlQuery);
query.setCacheable(true).setCacheRegion("TEST_REGION");
query.addScalar("emp_id");
query.addScalar("emp_first_name");
List list = query.list();
query.list() throws the following NPE:
java.lang.NullPointerException
at org.hibernate.type.TypeFactory.disassemble(TypeFactory.java:451)
at org.hibernate.cache.StandardQueryCache.put(StandardQueryCache.java:83)
at org.hibernate.loader.Loader.putResultInQueryCache(Loader.java:2194)
at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2138)
at org.hibernate.loader.Loader.list(Loader.java:2096)
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 poc.hibernate.caching.QueryCaching.fireNativeSql(QueryCaching.java:112)
at poc.hibernate.caching.QueryCaching.fireQuery(QueryCaching.java:38)
at poc.hibernate.caching.QueryCaching.main(QueryCaching.java:27)
I tried tracing through the Hibernate code code and saw that the types[] in the at the time of execution of types[i].disassemble( row[i], session, owner ) (TypeFactory.disassemble()) was holding both the types as null.
However before reaching that piece of code CustomLoader.autoDiscoverTypes(resultset) had already resolved the resultTypes to appropriate values.
Hope this helps.
--
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
13 years, 4 months
[Hibernate-JIRA] Created: (HHH-6020) Move to JBossTS caused some test failures in hibernate-envers
by Steve Ebersole (JIRA)
Move to JBossTS caused some test failures in hibernate-envers
-------------------------------------------------------------
Key: HHH-6020
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6020
Project: Hibernate Core
Issue Type: Bug
Components: envers
Reporter: Steve Ebersole
Assignee: Adam Warski
Fix For: 4.0.0.Alpha2
Specifically there is 1 tests that fails in both configurations for a total of 2 failures. The test class is {{org.hibernate.envers.test.integration.jta.JtaTransaction}}. The failure says:
{noformat}
null
org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:110)
at org.hibernate.service.internal.ServiceInitializer.configureService(ServiceInitializer.java:141)
at org.hibernate.service.internal.ServiceInitializer.initializeService(ServiceInitializer.java:108)
at org.hibernate.service.internal.ServiceRegistryImpl.getServiceInternal(ServiceRegistryImpl.java:119)
at org.hibernate.service.internal.proxy.javassist.ServiceProxyFactoryImpl$ServiceProxyMethodInterceptor.invoke(ServiceProxyFactoryImpl.java:114)
at org.hibernate.engine.jdbc.spi.JdbcServices_$$_javassist_0.getExtractedMetaDataSupport(JdbcServices_$$_javassist_0.java)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:77)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2848)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2844)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1825)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:77)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:888)
at org.hibernate.envers.test.AbstractEntityTest.init(AbstractEntityTest.java:123)
at org.hibernate.envers.test.AbstractEntityTest.init(AbstractEntityTest.java:97)
...
{noformat}
JdbcServicesImpl.java:110 is a simple attempt to use the {{java.sql.Connection}} returned by the configured {{org.hibernate.service.jdbc.connections.spi.ConnectionProvider}}:
{code}
Connection conn = connectionProvider.getConnection();
try {
DatabaseMetaData meta = conn.getMetaData(); // <- this is line 110
...
{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
13 years, 4 months
[Hibernate-JIRA] Created: (HSEARCH-753) fullTextQuery.getResultList().size() != fullTextQuery.getResultSize() when using criteria
by Mathieu Perez (JIRA)
fullTextQuery.getResultList().size() != fullTextQuery.getResultSize() when using criteria
-----------------------------------------------------------------------------------------
Key: HSEARCH-753
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-753
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.4.0.Final
Environment: hibernate 3.6.4.Final / postgresSQL
Reporter: Mathieu Perez
1) My indexes are up-to-date and optimised
2) I'm aware about this part of documentation: "Like Google, the number of results is approximative if the index is not fully up-to-date with the database (asynchronous cluster for example)."
3) Two types of queries:
3.1) Query with "keyword" (or "below"/"above"/"fromTo")
{code}
QueryBuilder qb = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity( Book.class ).get();
org.apache.lucene.search.Query query = qb
.keyword()
.onFields("title", "subtitle", "authors.name", "publicationDate")
.matching("Java rocks!");
.createQuery();
{code}
In this case, I don't meet any problem:
query.getResultSize() == query.getResultList().size()
3.2) Query with criteria
{code}
Criteria criteria = s.createCriteria( Book.class ).createCriteria('isbn').add(Restrictions.like('XXXXXX'))
Query q = s.createFullTextQuery( luceneQuery ).setCriteriaQuery( criteria );
{code}
In this case, the result is different:
{code}
query.getResultSize() != query.getResultList().size()
{code}
Actually, query.getResultSize() exactly returns the number of Book contained in my Book's table. (select count(*) from Book;) without taking in consideration my criteria.
I don't known if it's really a bug either it's the expected behaviour.
When inspecting the org.hibernate.search.query.engine.impl.HSQueryImpl java class, I realized that
{code}
QueryHits queryHits = getQueryHits( searcher, 0 ) :
{code}
- 3.1) Takes in charge my keyword
- 3.2) Doesn't seem to use my criteria
--
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
13 years, 4 months
[Hibernate-JIRA] Created: (HSEARCH-758) create DirectoryManager to handle different I/O aspects of an index
by Sanne Grinovero (JIRA)
create DirectoryManager to handle different I/O aspects of an index
-------------------------------------------------------------------
Key: HSEARCH-758
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-758
Project: Hibernate Search
Issue Type: Improvement
Reporter: Sanne Grinovero
Fix For: 4.0.0.Alpha1
Near-Real-Time Lucene usage requires a coupling between the indexwriter and the indexreaders being used for searches.
Also to make other features simpler we need to manage indexwriters and indexreaders in a more integrated form (Infinispan).
refactor : DirectoryProvider
* make a "DirectoryManager" instead, which is able to provide factories for both IndexReader an IndexWriters
* add utility methods like "getName()"
o (wish I had that in some cases to provide better error messages)
* Instead of trying to foresee all needed methods, the extension point should not be the DirectoryManager interface directly, but have people plug in different aspects.
* This is needed to eventually support:
o Instantiated indexes - HSEARCH-336
o make good use of all new so called "Near-Real-Time" Lucene improvements by having IndexReader and IndexWriter possibly generated by the same service
o reuse the JGroups channel used by the Infinispan Directory as transport for a backend (again, the two components need to interact)
--
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
13 years, 4 months