[Hibernate-JIRA] Created: (HHH-5297) Hibernate JPA closes XAConnection on Glassfish v3 with JDBC Wrapping
by Radosław Smogura (JIRA)
Hibernate JPA closes XAConnection on Glassfish v3 with JDBC Wrapping
--------------------------------------------------------------------
Key: HHH-5297
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5297
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Final
Environment: Glassfish v 3
Reporter: Radosław Smogura
Priority: Critical
In EJB application at 90% the Hibernate closes original physicall connectiont o XA database. This problem occurs when JDBC Object wrapping is turned on in Glassfiah admin console.
This bug is "upstream" of this https://glassfish.dev.java.net/issues/show_bug.cgi?id=11846.
Orginal initial comment, and some comments:
----------------------
I use PostgreSQL 8.4 with trunk and stable driver. When I use statement caching
with wrapping original objects I got exception that statement is closed. My
investigation shwn close of original Polled Connection in
com.sun.gjc.spi.ManagedConnection.transactionCompleted. Problem disappears
after few calls of same statement. This problem doesn't occurs when wrapping is
turned off. In both cases I use XA poll.
Caused by: org.postgresql.util.PSQLException: Statement has been closed.
at
org.postgresql.ds.jdbc23.AbstractJdbc23PooledConnection$StatementHandler.invoke(AbstractJdbc23PooledConnection.java:448)
at $Proxy227.clearParameters(Unknown Source)
at
com.sun.gjc.spi.base.PreparedStatementWrapper.clearParameters(PreparedStatementWrapper.java:380)
at
com.sun.gjc.spi.base.PreparedStatementWrapper.close(PreparedStatementWrapper.java:755)
at
org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:563)
-----------------
This problem isn't visible if PooligDatasource is used.
-----------------
I used 3.5.2 Release and it's looks same. Before 1st submiting bug I
thought that this is GF problem, becasue in EJB I was trying to get
XAConnection by resource injection and same problem occured (this EJB was mixed
Hibernate + JDBC), but now i'm going to point that this is Hibernate problem.
I'll do some other checks, and if this will be Hibernate problem I'll fill bug
in Hib.
I created application without Hibernate (old plain JNDI) and it looks that
there is no error - so this coud be hibernate. But i want to do more test,
about this (eg. take XAConnection from server global JNDI, without
java:comp/env).
-----------------
---
Kind regards,
Radosław Smogura
http://www.softperience.eu
--
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
14 years, 7 months
[Hibernate-JIRA] Created: (EJB-385) JPA method of merge failed to insert deleted records from database
by Hari (JIRA)
JPA method of merge failed to insert deleted records from database
-------------------------------------------------------------------
Key: EJB-385
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-385
Project: Hibernate Entity Manager
Issue Type: Improvement
Components: EntityManager
Affects Versions: 3.2.0.ga
Environment: 3.2.6.ga, Weblogic,JPA, Windows
Reporter: Hari
The following is my requirement.
Suppose i have a record in database with id say, 12.
i have retrieved this using a JPQL query and convert it into a transfer object ,done some processing and going to remerge this after converting it to a new entity but the id set in the new entity is same as old one ie 12.
Now just before calling entityManger.merge i have deleted the record with id 12 from database.
The issue is the merge opeartion is not inserting the record in database at all.
But if the id set in the entity is one which is never occured in the database,the merge operation will insert the record with the id set from teh application.
Is there any work around/fix for this issue.
Regards
Harikrishnan R
--
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
14 years, 7 months
[Hibernate-JIRA] Created: (HHH-4066) JPA compatibility problem
by Albert Kurucz (JIRA)
JPA compatibility problem
-------------------------
Key: HHH-4066
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4066
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.2
Environment: Hibernate Core 3.3.2, problem is independent from database type (actually appeared with Derby 10.4.2)
Reporter: Albert Kurucz
POJO Entity with 100% JPA annotations, as long as the Class did not implement the Map interface everything worked fine (save to and load from database).
After the Class implemented the Map interface, during object persistence, 'get' was called with '$type$' parameter, and 'get' responded with IllegalArgumentException (in accordance to its design).
Workaround implemented: get now responds to this call by returning getClass().getName()
BUT Hibernate should not need this workaround if it is 100% JPA compliant.
On the above example the Map interface of the Entity Class had no connection with persisted variables, only transients.
In the JPA spec there is no restriction what I know of, which would disallow the implementation of Map by an Entity Class.
In the JPA spec there is no requirement what I know of, which would require and Entity Class which implement the Map interface to implement the Map interface in any special way (like 'get' responding to '$type$').
Correct me if I am wrong.
--
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
14 years, 7 months
[Hibernate-JIRA] Created: (HHH-6590) Allow for exclusion of persisted classes by package in metamodel
by Robert Brady (JIRA)
Allow for exclusion of persisted classes by package in metamodel
----------------------------------------------------------------
Key: HHH-6590
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6590
Project: Hibernate Core
Issue Type: Improvement
Components: entity-manager
Affects Versions: 3.5.5
Environment: Hibernate 3.5.5, PostgreSQL 8.4
Reporter: Robert Brady
This improvement would work around the need for "any" mapping support as given in HHH-6589.
I am upgrading from Hibernate 3.2.x to 3.5.5 and getting UnsupportedOperationExceptions thrown when Hibernate is trying to create the metamodel. This is due to the dependency of my application upon jBPM 3.x, which uses "any" mappings for some of its classes.
If Hibernate can not support "any" mappings then it could workaround this limitation by allowing for the exclusion of persistent classes by package name. For example, in my application I have no need for the metamodel to include the jBPM classes (don't need criteria api to be applied to them). These classes contain "any" mappings that break the generation of the metamodel. The metamodel boundaries could be cleanly set if all the jBPM classes (packages org.jbpm.*) were excluded from the generation of the metamodel. This could be done like so in org.hibernate.ejb.EntityManagerFactoryImpl constructor:
{noFormat}
...
List<PersistentClass> persistentClasses = new ArrayList<PersistentClass>();
while (classes.hasNext()) {
PersistentClass persistentClass = classes.next();
// Hardcode jBPM classes for now, but make tidy with a property like "hibernate.ejb.metamodel.excluded.pkgs"
if (persistentClass.getClassName().startsWith("org.jbpm")) {
continue;
} else {
persistentClasses.add(persistentClass);
}
}
// a safe guard till we are confident that metamodel is wll tested
if (!"disabled".equalsIgnoreCase(cfg.getProperty("hibernate.ejb.metamodel.generation"))) {
this.metamodel = MetamodelImpl.buildMetamodel(persistentClasses.iterator(),
(SessionFactoryImplementor) sessionFactory);}
...
{noFormat}
A configuration list property with items being the package root names to exclude should work.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months