[Hibernate-JIRA] Created: (METAGEN-51) C3P0 connection pool tester is not called if buildSessionFactory failed due to wrong password
by asd (JIRA)
C3P0 connection pool tester is not called if buildSessionFactory failed due to wrong password
---------------------------------------------------------------------------------------------
Key: METAGEN-51
URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-51
Project: Hibernate Metamodel Generator
Issue Type: Bug
Environment: I used Hibernate+C3P0.
Here is a my config:
setProperty("hibernate.connection.driver_class",
"com.mysql.jdbc.Driver");
setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect");
setProperty("hibernate.connection.url", "jdbc:mysql://localhost:"
+ getDBPort() + "/emplatcore");
setProperty("hibernate.connection.username", Network.getInstance()
.getMASDBAccountCred().getUserName());
setProperty("hibernate.connection.password", Network.getInstance()
.getMASDBAccountCred().getPassword());
setProperty("hibernate.show_sql", "false");
setProperty("hibernate.c3p0.aquire_increment",
Integer.toString(getConnectionAcquireIncrement()));
setProperty("hibernate.c3p0.idle_test_period",
Integer.toString(getIdleTestPeriod()));
setProperty("hibernate.c3p0.timeout",
Integer.toString(getIdleTimeout()));
setProperty("hibernate.c3p0.max_size",
Integer.toString(getMaxConnections()));
setProperty("hibernate.c3p0.max_statements",
Integer.toString(getStatementCache()));
setProperty("hibernate.c3p0.min_size",
Integer.toString(getInitialPoolSize()));
setProperty(
"c3p0.connectionTesterClassName",
"com.nortelnetworks.mcp.ne.mediaserver.db.dao.hibernate.c3p0.MCPHibernateConnectionTester");
setProperty("c3p0.acquireRetryAttempts",
Integer.toString(getAcquireRetryAttempts()));
setProperty("c3p0.acquireRetryDelay",
Long.toString(getAcquireRetryDelay()));
Reporter: asd
Assignee: Hardy Ferentschik
Priority: Critical
I tried to check if connect is up or down to MySQL using C3P0 connection pool tester. It works if password is correct. But password can be changed and I need to let user know that there is no connection to MySQL.
I want to understand why buildSessionFactory() does not start connection tester.
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-5359) Derived entity usecase fails when the association is bidirectional
by Hardy Ferentschik (JIRA)
Derived entity usecase fails when the association is bidirectional
------------------------------------------------------------------
Key: HHH-5359
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5359
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.5.3
Reporter: Hardy Ferentschik
Fix For: 3.6
See https://forum.hibernate.org/viewtopic.php?f=9&t=1005649
The exception is
{noformat}
org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: org.hibernate.test.annotations.derivedidentities.bidirectional.Dependent.emp in org.hibernate.test.annotations.derivedidentities.bidirectional.Employee.dependents
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:655)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:619)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1221)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:383)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1377)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at org.hibernate.test.annotations.TestCase.buildConfiguration(TestCase.java:114)
at org.hibernate.test.annotations.HibernateTestCase.setUp(HibernateTestCase.java:133)
at org.hibernate.test.annotations.HibernateTestCase.runBare(HibernateTestCase.java:80)
at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:108)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:64)
{noformat}
The mapping is as follows:
{code}
@Entity
public class Employee {
@Id
long empId;
String empName;
@OneToMany(mappedBy = "emp", fetch = FetchType.LAZY)
private Set<Dependent> dependents;
}
{code}
{code}
@Entity
//(a)IdClass(DependentId.class)
public class Dependent implements Serializable {
@Id
@ManyToOne
Employee emp;
String name;
}
{code}
It does not work with @IdClass either.
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-5529) Bulk delete on Entity with @ElementCollection ignores the @CollectionTable
by Pascal Thivent (JIRA)
Bulk delete on Entity with @ElementCollection ignores the @CollectionTable
--------------------------------------------------------------------------
Key: HHH-5529
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5529
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 3.6.0.Beta4, 3.6.0.Beta3, 3.5.5, 3.6.0.Beta2, 3.6.0.Beta1, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0-Final, 3.5.0-CR-2, 3.5.0-CR-1, 3.5.0-Beta-4, 3.5.0-Beta-3, 3.5.0-Beta-2, 3.5.0.Beta-1
Environment: Hibernate 3.5.x, all database, all platforms.
Reporter: Pascal Thivent
Attachments: HHH-XXX.tar.gz
I have an entity with a collection of basic elements mapped with @ElementCollection:
{code}
@Entity
public class Foo {
@Id @GeneratedValue
private Long id;
@ElementCollection
@Column(name = "bar_column")
@CollectionTable(name = "Bar")
private Set<String> bars = new HashSet<String>();
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public Set<String> getBars() { return bars; }
public void setBars(Set<String> bars) { this.bars = bars; }
}
{code}
A bulk delete on this entity fails due to constraint violation on the collection table (Hibernate ignores the collection table).
I don't think that the following cascading restriction from the JPA 2.0 specification applies:
{quote}
h3. 4.10 Bulk Update and Delete Operations
...
A delete operation only applies to entities of the specified class and its subclasses. It does not cascade to related entities.
{quote}
In other words, Hibernate should handle the collection table as we have no way to bulk delete the basic elements from the collection table.
I have attached a test case allowing to reproduce the 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
14 years, 1 month
[Hibernate-JIRA] Created: (HHH-5280) "java.lang.IllegalArgumentException: object is not an instance of declaring class" when persisting a object graph containing the same transient objetc twice.
by Benjamin Lerman (JIRA)
"java.lang.IllegalArgumentException: object is not an instance of declaring class" when persisting a object graph containing the same transient objetc twice.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-5280
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5280
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.2
Environment: Hibernate 3.5.2
Db: All? (At least h2 and mysql)
Reporter: Benjamin Lerman
Priority: Critical
Attachments: hibernate-multi-parent.tgz, test.entity.TestCreate.txt
I attach a maven project showing the bug.
I have 3 classes, A, B, C with
C have a one-to-many unidirectional relation to B and A.
B have a one-to-many unidirectional relation to A.
Those relations are mapped by foreign keys.
The cascading properties for those relations are all save-update,persist
For each of those relations, the inverse cardinality is 1 (which means A must be associated with a B and a C, and B must be associated with a C).
I create an instance of C that I associate to an instance of B and an instance of A, and I associate the instance of B with the instance of A.
I then try to save C, and I get the attached exception.
For what I understood the problem is with the method StatefulPersistenceContext.getOwnerId: this method use a cache to retrieve the parent of the instance of A, but because A has 2 different parents (the instance of B and the instance of C), it does not retrieve the right one and try to call a method on the wrong entity.
--
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, 2 months