Re: [hibernate-dev] MetadataSourceProcessor and associations
by Gail Badner
It seems that JoinColumnResolutionDelegate impls can have the same problem.
----- Original Message -----
> From: "Steve Ebersole" <steven.ebersole(a)gmail.com>
> To: "Gail Badner" <gbadner(a)redhat.com>
> Cc: "Hibernate hibernate-dev" <hibernate-dev(a)lists.jboss.org>
> Sent: Wednesday, January 23, 2013 11:16:23 AM
> Subject: Re: [hibernate-dev] MetadataSourceProcessor and associations
>
> What you mention is in fact possible.
>
> And I have never been very hopeful about the "chasing" approach...
>
>
> On Wed 23 Jan 2013 01:13:48 PM CST, Gail Badner wrote:
> > Is it possible for an entity containing one side of an association
> > be mapped using annotations and the entity containing the opposite
> > side of the association be mapped using an hbm mapping?
> >
> > For example, suppose Order has annotations:
> >
> > @OneToMany( mappedby="order" )
> > List<OrderLine> Order.orderLines
> >
> > OrderLine is mapped using hbm.xml with:
> >
> > <many-to-one name="order"/>
> >
> > If annotations are processed first, then, IIUC, when
> > Order.orderLines is processed, the mapping for OrderLine won't be
> > found (via chasing) because the
> > AnnotationMetadataSourceProcessorImpl does not have the source for
> > the OrderLine mapping. As a result, the OrderLine EntityBinding
> > will not be able to be built until HbmMetadataSourceProcessorImpl
> > is processed.
> >
> > If so, this poses a fundamental problem with entity "chasing" as it
> > is implemented now, since the associated entity would not be
> > processed by the same MetadataSourceProcessor.
> >
> > Am I missing something here?
> >
> > Thanks,
> > Gail
> > _______________________________________________
> > hibernate-dev mailing list
> > hibernate-dev(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
11 years, 3 months
Should CollectionEntry::snapshot Include The Results Of Queued Operations?
by John Walker
In hibernate 3.6.10, CollectionEntry::snapshot is sometimes initialized
after queued operations (SimpleAdd, Clear,etc) are processed. As a result,
the snapshot can contain transient entities, and does not accurately reflect
the state of the collection in the database.
Is this intentional, or should the CollectionEntry::snapshot be taken
*after* all queued operations have been performed?
For an example of what I'm talking about, see
org.hibernate.engine.loading.CollectionLoadContext::endLoadingCollection(Loa
dingCollectionEntry, CollectionPersister).
This method calls endRead(), which for some collections (like PersistentBag)
applies queued operations. Then it calls
CollectionEntry::postInitialize(), which takes the initial snapshot of the
collection.
Sorry to keep bugging you guys about this. (I posted a similar question
about the same problem.) I've been having trouble finding good sources of
information about Hibernate archecture/how things are "supposed" to work.
Thanks!
-John
11 years, 3 months
OGM (mongodb) on AS 7.1 with Arquillian
by Guillaume SCHEIBEL
Hello,
I want to deploy an OGM (mongodb of course) app on AS 7.1 with Arquillian
for a demo (at ElsassJUG).
I have installed OGM and OGM-monogdb as a module based on the ehcache
module (btw, I'll have to create the mongodb part).
But when I deploy the app, I have the following error:
Caused by: javax.naming.NameNotFoundException: ---PlaceHolderDSForOGM--- --
service jboss.naming.context.java.---PlaceHolderDSForOGM---
Based on the sources, I found this:
//we use a placeholder DS to make sure, Hibernate EntityManager
(Ejb3Configuration) does not enforce a different connection provider
map.put( Environment.DATASOURCE, "---PlaceHolderDSForOGM---" );
The point is I don't know how to avoid this exception.
The current version of the project is here:
https://github.com/gscheibel/OgmAtElsassJUG
The ogm-mongodb module file is here:
https://gist.github.com/4588287
The main ogm module file is here:
https://gist.github.com/4588301
Any thoughts ?
Thanks
Guillaume
11 years, 3 months
Error: registry contains more than one (2) entity manager factories: PERSISTENCE_UNIT_NAME
by Teresa Batista Neto
Dear all,
After upgrading JPA from 3.6.1 to 4.1.8 I start getting the following error:
"Error: registry contains more than one (2) entity manager factories:
PERSISTENCE_UNIT_NAME"
Below you can find a brief summary of our specification requirements.
- User logins in the web application using their own oracle database
account.
- The web application only needs to access one database schema;
- The access rights are managed using oracle roles and grant privilegies.
- Only one database schema and multiple user oracle accounts.
- We only set the username and password when users tries to login in the
web application.
- The EntityManagerFactory is created using the username and password of
the user.
- Because our web application only access one database we only use one
persistence unit name.
E.g. persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="PERSISTENCE_UNIT_NAME">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.connection.driver_class" value="oracle.jdbc.
OracleDriver">
<property name="hibernate.connection.url" value="jdbc:oracle:xx...">
<property name="hibernate.dialect" value="org.hibernate.dialect.
Oracle10gDialect">
<property name="hibernate.default_schema" value="SCHEMA_NAME">
<property name="hibernate.connection.username" value="USERNAME">
<property name="hibernate.connection.password" value="PASSWORD">
<property name="hibernate.connection.autocommit" value="false">
<property name="hbm2ddl.auto" value="validate">
<property name="hibernate.show_sql" value="true">
<property name="hibernate.format_sql" value="true">
</properties>
</persistence-unit>
</persistence>
E.g. how we create and close the entity manager factory
Map<String, String> configuration = new ProviderConfiguration();
configuration.put("hibernate.connection.username", username);
configuration.put("hibernate.connection.password", password);
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("PERSISTENCE_UNIT_NAME",
configuration);
EntityManager em = emf.createEntityManager();
SptrTaxNode t = em.find(SptrTaxNode.class, 9606);
em.close();
emf.close();
Does anyone ever had a similar situation? Any ideas on how can I solve this
problem?
Thanks in advance,
Teresa
11 years, 3 months
Re: [hibernate-dev] Hibernate ORM 4.1.10.Final on Wed?
by Steve Ebersole
I agree. I think we need to get this HHH-6361 issue sorted first.,
before doing a release.
On Wed 16 Jan 2013 10:51:08 AM CST, Steve Ebersole wrote:
>
> I agree. I think we need to get this HHH-6361 issue sorted first.
>
> On Wed 16 Jan 2013 08:15:03 AM CST, Scott Marlow wrote:
>>
>> On 01/14/2013 01:53 PM, Brett Meyer wrote:
>>>
>>> Hibernate ORM 4.1.10.Final is scheduled for this Wed., 1/16. Any
>>> issues with doing so?
>>
>>
>> Should we fix or revert the HHH-6361 changes?
>>>
>>>
>>> We're watching a few Javassist issues -- regressions from Javassist
>>> 3.17.1 that was included with Hibernate 4.1.9.Final. If those are
>>> not resolved by Wed., we will most likely revert back to Javasist
>>> 3.15 in Hibernate 4.1.10. The reasoning for the upgrade was
>>> performance only. However, enough users have reported the
>>> regression that it's more important to revert.
>>>
>>> Thanks!
>>>
>>> Brett Meyer
>>> Red Hat Software Engineer, Hibernate
>>> +1 260.349.5732
>>>
>>> _______________________________________________
>>> hibernate-dev mailing list
>>> hibernate-dev(a)lists.jboss.org
>>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>>>
>>
>>
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev
11 years, 3 months
XSD question
by Strong Liu
Hi,
There is an XSD question that I need some help
suppose I want to design the xsd with following requirements:
1. element A has sub elements of B, C, D, E
2. sub elements should be not forced to be ordered ( so, choice :)
3. B --- maxOccurs = 1, minOccurs = 1
4. C,D -- maxOccurs = unbounded, minOccurs = 0
5. E -- maxOccurs = 1, minOccurs = 0
-------------------------
Best Regards,
Strong Liu <stliu at hibernate.org>
http://about.me/stliu/bio
11 years, 3 months
Hibernate ORM 4.1.10.Final on Wed?
by Brett Meyer
Hibernate ORM 4.1.10.Final is scheduled for this Wed., 1/16. Any issues with doing so?
We're watching a few Javassist issues -- regressions from Javassist 3.17.1 that was included with Hibernate 4.1.9.Final. If those are not resolved by Wed., we will most likely revert back to Javasist 3.15 in Hibernate 4.1.10. The reasoning for the upgrade was performance only. However, enough users have reported the regression that it's more important to revert.
Thanks!
Brett Meyer
Red Hat Software Engineer, Hibernate
+1 260.349.5732
11 years, 3 months
Should Hibernate support @Id for embedded IDs
by Gail Badner
I've noticed that some failures using the new metamodel are due to embedded IDs being annotated with @Id instead of @EmbeddedId.
Should Hibernate support this mapping?
Thanks,
Gail
11 years, 3 months