[Hibernate-JIRA] Created: (HHH-3018) Configuration element to tell Hibernate to have just one insert to flush an entity and not both an insert and an update.
by Nicolas Cazottes (JIRA)
Configuration element to tell Hibernate to have just one insert to flush an entity and not both an insert and an update.
------------------------------------------------------------------------------------------------------------------------
Key: HHH-3018
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3018
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.2.5
Reporter: Nicolas Cazottes
Attachments: testXMLTypeUpdates.zip
While analyzing the SQL queries Hibernate generates to persist objects, I fall on a behaviour, that I first found strange, which is that in one flush of one transaction, there may be both an insert and an update for a given entity. My first expectation was to have only one insert and no update.
After a few search, I discover that conversation (http://forum.hibernate.org/viewtopic.php?p=2191664&sid=c571096bda4a6b636e...) that explains it is normal in the case of a save with modifications after save.
I discover (cf the classes of my zip showing it) that this behaviour is also present in the case of a relation that is managed by cascade. What I noticed is that the insert of the related entity is planned when the first hql query is executed after the relation has been established. So if the related entity is modified after the query execution (for exemple depending on the result of the query), an update will be executed.
This behaviour is understandable but in my case, the update is really expensive (because it acts on an XMLType column) and unless I set a FlushMode to COMMIT (which I found really not a good solution), I can not control that Hibernate will generate both an insert and an update or only an insert. I know I could also set the relation just before the commit in order to avoid insert+update but this solution is not possible in my case and I find it not elegant (it would break the semantic of the cascade of the relation).
I suggest to introduce a new configuration element (similar to the flushmode) in Hibernate in order to be able to have control whether Hibernate generates an insert containing the data of the entity at the first save or an insert containing the data of the entity at the flushing time.
Note : The attached files (which is the smallest extraction of what does my application) shows that behaviour both for the save call and the cascade declenched by a query.
Note2 : I found an issue in jira number 2621 submited by someone else that is related to this subject in think.
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (HHH-2426) Misleading logging messages when using ThreadLocalSessionContext
by Don Smith (JIRA)
Misleading logging messages when using ThreadLocalSessionContext
----------------------------------------------------------------
Key: HHH-2426
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2426
Project: Hibernate3
Type: Improvement
Components: core
Versions: 3.2.0.ga
Reporter: Don Smith
Priority: Minor
The log messages printed out by TransactionFactoryFactory and SettingsFactory are misleading when using ThreadLocalSessionContext:
2007-02-09 21:49:58,581 INFO [org.hibernate.transaction.TransactionFactoryFactory:info] Using default transaction strategy (direct JDBC transactions)
2007-02-09 21:49:58,588 INFO [org.hibernate.transaction.TransactionManagerLookupFactory:info] No TransactionManagerLookup Configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2007-02-09 21:49:58,590 INFO [org.hibernate.cfg.SettingsFactory:info] Automatic flush during beforeCompletion(): disabled
2007-02-09 21:49:58,591 INFO [org.hibernate.cfg.SettingsFactory:info] Automatic session close at end of transaction: disabled
This does not indicate that sessions will be closed after commit, which is the behavior when using ThreadLocalSessionContext.
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (ANN-682) @ForeignKey override of @MappedSuperclass
by Christian Bauer (JIRA)
@ForeignKey override of @MappedSuperclass
-----------------------------------------
Key: ANN-682
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-682
Project: Hibernate Annotations
Issue Type: New Feature
Components: binder
Reporter: Christian Bauer
Put this @ManyToOne in a @MappedSuperclass:
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "CREATED_BY_USER_ID", nullable = false)
// Ideally this foreign key should be ON DELETE SET NULL, however...
// Hibernate can't rename these so subclasses would get the same FK constraint name. This doesn't
// work, so we need to let Hibernate create a random identifier for these. We could fix this in the
// DatabaseObjects.hbm.xml file but we can't even address it because the name is random. This sucks.
// So we do a manual SET NULL|DEFAULT when userHome.remove() is called.
// @org.hibernate.annotations.ForeignKey(name = "FK_WIKI_NODE_CREATED_BY_USER_ID")
protected User createdBy;
Now all subclasses get that foreign key constraint name in the database catalog, which isn't possible - constraint names have to be unique.
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (HSEARCH-527) Hibernate Search Not giving any errror when @DocumentId not mentioned, but hangs at configuration.buildSessionFactory()
by Kiran Narasareddy (JIRA)
Hibernate Search Not giving any errror when @DocumentId not mentioned, but hangs at configuration.buildSessionFactory()
-----------------------------------------------------------------------------------------------------------------------
Key: HSEARCH-527
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-527
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.1.0.GA
Environment: Hibernate core : 3.3.1 GA, Hibernate Annotations : 3.4.0.GA, Hibernate commons Annotations : 3.1.0 GA, Lucene core 2.4.1
Mysql Community 5.0.41
Reporter: Kiran Narasareddy
Priority: Minor
Consider a case in which primary key is associated with only Base class, with no primary key in any other subclasses marked for Lucene's document id.
Now, if this attribute is not annotated with @DocumentId, hibernate engine shows no errors, but it hangs up at configuration.buildSessionFactory(); and doesn't move forward.
The moment the annotation is added, the SessionFactory gets built and the application works.
Example Model :
Aobject.java :
long id; (this is the intended field to be taken as documentID for lucene )
MyObject extends Aobject
(This class is to be indexed.It has no id field of its own, the same id from AObject acts as PK for MyObject Also)
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (HHH-3339) Query cache stops working after object save
by Alex Oleynikov (JIRA)
Query cache stops working after object save
-------------------------------------------
Key: HHH-3339
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3339
Project: Hibernate3
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6, MS SQL 2005 Database. Windows XP SP2
Reporter: Alex Oleynikov
It seems like HB Query cache stops working as soon as given object type is being saved (it does not matter if it was save to existing object or insert of new object instance).
The code looks like this. Where User is just a primitive POJO with couple of properties.
// #1
query = session.createQuery("from User where userID = :id");
query.setCacheable(true);
query.setParameter("id", 10);
user = (User) query.list().get(0);
// #2
query = session.createQuery("from User where userID = :id");
query.setCacheable(true);
query.setParameter("id", 10);
user = (User) query.list().get(0);
// insert new User object
user = new User();
user.setUserID((int)(Math.random() * Integer.MAX_VALUE));
user.setUserName("Ten");
session.beginTransaction();
session.save(user);
session.getTransaction().commit();
// #3
query = session.createQuery("from User where userID = :id");
query.setCacheable(true);
query.setParameter("id", 10);
user = (User) query.list().get(0);
// #4
query = session.createQuery("from User where userID = :id");
query.setCacheable(true);
query.setParameter("id", 10);
user = (User) query.list().get(0);
>From MS SQL Profiler I can clearly see that no queries is executed for #2 (e.g. it hit the cache), but queries are executed for #3 and #4. From HB debug log I see following:
For #2 Query (cache is hit) - correct:
06:54:25,337 DEBUG StandardQueryCache:102 - checking cached query results in region: org.hibernate.cache.StandardQueryCache
06:54:25,337 DEBUG StandardQueryCache:156 - Checking query spaces for up-to-dateness: [USERS]
06:54:25,337 DEBUG StandardQueryCache:117 - returning cached query results
During User insert:
06:54:25,368 DEBUG UpdateTimestampsCache:65 - Invalidating space [USERS], timestamp: 4967466866147328
For #3 Query:
06:54:25,368 DEBUG StandardQueryCache:156 - Checking query spaces for up-to-dateness: [USERS]
06:54:25,368 DEBUG UpdateTimestampsCache:86 - [USERS] last update timestamp: 4967466866147328, result set timestamp: 4967466865061888
06:54:25,368 DEBUG StandardQueryCache:113 - cached query results were not up to date
For #4 Query (or any subsequent query for this matter):
06:54:25,368 DEBUG StandardQueryCache:156 - Checking query spaces for up-to-dateness: [USERS]
06:54:25,368 DEBUG UpdateTimestampsCache:86 - [USERS] last update timestamp: 4967466866147328, result set timestamp: 4967466865061888
06:54:25,368 DEBUG StandardQueryCache:113 - cached query results were not up to date
Please note the timestamp numbers for #4 query - even though I would expect query to be re-cached in #3, it still shows old timestamp. So I may think that when re-caching a query it does not update cache entry timestamp which is not up-to-date due to save().
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (HHH-5310) Mapping files in JPA2 fail to load
by David Loeffler (JIRA)
Mapping files in JPA2 fail to load
----------------------------------
Key: HHH-5310
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5310
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.5.2
Environment: Hibernate 3.5.2, Postgres 8.4.4, GlassFish 3, NetBeans 6.9 RC2
Reporter: David Loeffler
I have a Java EE 6 project that has a large number of named queries. The named queries are organized into a number of files that are specified in the persistence.xml file with the <mapping-file> tags. However on deploying to the app server Hibernate throws an exception that the version "2.0" should not be used, it should be "1.0". This is the version of JPA which is specified in other files like orm.xml (no error from this file, even though it is basically empty).
If I switch to eclipselink things work fine. Why do I not want to use eclipselink then? Because it has an error with collections of enums where it uses varchar instead of int no matter how much I tweak the annotations.
I did a small sample application with hibernate where I had only the orm.xml file. That worked just fine. Here is a sample of the header the included mapping file that got the error
{code:title=META-INF/course-queries.xml|borderStyle=solid}
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
...
</entity-mappings>
{code}
{noformat}
WARNING: DPL8030: Sun specific deployment descriptor (WEB-INF/sun-web.xml in archive /Users/loeffler/NetBeansProjects/DC4/dist/gfdeploy/DC4/DC4-war_war/) is deprecating, please use Glassfish specific deployment descriptor WEB-INF/glassfish-web.xml in the future.
SEVERE: log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
SEVERE: log4j:WARN Please initialize the log4j system properly.
SEVERE: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
SEVERE: Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml
at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661)
at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285)
at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245)
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507)
at java.lang.Thread.run(Thread.java:637)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:343)
at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716)
... 43 more
SEVERE: Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method
org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:161)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507)
at java.lang.Thread.run(Thread.java:637)
Caused by: org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml
at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661)
at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285)
at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245)
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133)
... 29 more
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:343)
at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716)
... 43 more
SEVERE: Exception while preparing the app
org.glassfish.deployment.common.DeploymentException: invalid mapping: META-INF/course-queries.xml
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:161)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:312)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:199)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:286)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:322)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:337)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:965)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:92)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1088)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1077)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:366)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:203)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:113)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:802)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:705)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:986)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:178)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:526)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:507)
at java.lang.Thread.run(Thread.java:637)
Caused by: org.hibernate.MappingException: invalid mapping: META-INF/course-queries.xml
at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:718)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:593)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:193)
at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:109)
at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:135)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:661)
at org.glassfish.javaee.full.deployment.EarDeployer.prepareBundle(EarDeployer.java:285)
at org.glassfish.javaee.full.deployment.EarDeployer.access$200(EarDeployer.java:81)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:136)
at org.glassfish.javaee.full.deployment.EarDeployer$1.doBundle(EarDeployer.java:133)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnBundles(EarDeployer.java:210)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllTypedBundles(EarDeployer.java:219)
at org.glassfish.javaee.full.deployment.EarDeployer.doOnAllBundles(EarDeployer.java:245)
at org.glassfish.javaee.full.deployment.EarDeployer.prepare(EarDeployer.java:133)
... 29 more
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'entity-mappings' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:417)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3181)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2801)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2713)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2065)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.dom4j.io.SAXReader.read(SAXReader.java:343)
at org.hibernate.ejb.Ejb3Configuration.addXMLEntities(Ejb3Configuration.java:716)
... 43 more
{noformat}
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (HHH-3407) @TableGenerator does not increment pkColumnValue by allocationSize
by Dan Ciarniello (JIRA)
@TableGenerator does not increment pkColumnValue by allocationSize
------------------------------------------------------------------
Key: HHH-3407
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3407
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.6, 3.2.4
Environment: JBoss 4.2.3, RHEL4, JDK1.5
Reporter: Dan Ciarniello
According to the JPA, the allocationSize attribute to @TableGenerator is "The amount to increment by when allocating id numbers from the generator" but the value is actually incremented by 1 regardless of allocationSize. The id is generated properly apparently according to the formula
id = lastkeyval*allocationSize + i where 0<i<allocationSize
The problems with this algorithm are:
1. One cannot tell what the next key value range is from the key table without knowing the allocationSize (minor)
2. If the allocationSize is reduced, already existing key values will be generated (major)
3. If two applications are configured with different allocation sizes, there will be an overlap in generated values (major)
--
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
15 years, 7 months