[JBoss JIRA] Resolved: (EJBTHREE-597) javax.persistence.SequenceGenerator mapped to "seqhilo" and not "sequence" by org.hibernate.cfg.AnnotationBinder
by Emmanuel Bernard (JIRA)
[ http://jira.jboss.com/jira/browse/EJBTHREE-597?page=all ]
Emmanuel Bernard resolved EJBTHREE-597.
---------------------------------------
Resolution: Rejected
Assignee: Emmanuel Bernard
this is as per the spec, use allocationSze=1
> javax.persistence.SequenceGenerator mapped to "seqhilo" and not "sequence" by org.hibernate.cfg.AnnotationBinder
> ----------------------------------------------------------------------------------------------------------------
>
> Key: EJBTHREE-597
> URL: http://jira.jboss.com/jira/browse/EJBTHREE-597
> Project: EJB 3.0
> Issue Type: Bug
> Affects Versions: EJB 3.0 RC7 - FD
> Environment: JBoss 4.0.4.GA (using EJB3 packaged in that version of JBoss), Windows XP SP1, Java 1.5.04, Oracle 9
> Reporter: David Richmond
> Assigned To: Emmanuel Bernard
>
> @javax.persistence.SequenceGenerator(name = "Question_id_sequence", sequenceName = "S_QUESTION")
> is mapped to a "seqhilo" generator by org.hibernate.cfg.AnnotationBinder (line 332) which causes strange ids to be generated. These ids appear to have no relation to the actual sequence state, even though "select S_QUESTION.nextVal from dual" is generated by Hibernate through JDBC. The ids start at 50 for an intial deployment, 150 after a redeployment, then 250 for the following deployment, etc, etc.
> If stored procedures are used which use the S_QUESTION sequence to insert rows into the same table then a conflict will happen sometime in the future, since Hibernate does not use the value from the sequence.
> If I replace the above @javax.persistence.SequenceGenerator definition with:
> @org.hibernate.annotations.GenericGenerator(name="Question_id_sequence", strategy = "sequence",
> parameters = { @Parameter(name="sequence", value="S_QUESTION") } )
> the actual S_QUESTION.nextVal value is used correctly by Hibernate.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Created: (EJBTHREE-649) Query Performance within transaction decreasing progressively when using default FlushModeType.AUTO
by Andreas Zimmer (JIRA)
Query Performance within transaction decreasing progressively when using default FlushModeType.AUTO
---------------------------------------------------------------------------------------------------
Key: EJBTHREE-649
URL: http://jira.jboss.com/jira/browse/EJBTHREE-649
Project: EJB 3.0
Issue Type: Bug
Affects Versions: EJB 3.0 RC8 - FD
Environment: WinXP SP2, Oracle 9i Enterprise Rel. 9.2.0.1.0, JBoss 4.0.4GA, EJB3.0 RC8-FD
Reporter: Andreas Zimmer
Query Performance within a Transaction is progressively decreasing when working with EJB3.0 default FlushModeType.AUTO:
20 queries/reads within transaction - 10 msecs average per query/read
1000 (same as before) queries/reads within transaction - 130 msecs average per query/read (factor 13+)
With FlushModeType.COMMIT query performance within the same scenario ist constant at expected 10 msecs but FlushModeType.COMMIT imposes restrictions which our projects can't cope with. We need updates within transaction being visible in subsequent queries of the same transaction.
The case is explained in some detail in the JBoss Forum Thread as provided in JBoss Forum Reference.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Created: (EJBTHREE-793) OneToMany (parent-child) with composite PK fails when inserting a child.
by Gunnar Grim (JIRA)
OneToMany (parent-child) with composite PK fails when inserting a child.
------------------------------------------------------------------------
Key: EJBTHREE-793
URL: http://jira.jboss.com/jira/browse/EJBTHREE-793
Project: EJB 3.0
Issue Type: Bug
Environment: Linux
Reporter: Gunnar Grim
OneToMany (parent-child) with composite PK on the child side fails when inserting a child. Only the first part of the PK has a value. Before em.persist, both key attributes have values but JBoss attempts to insert null into the second key attribute.
The application works fine on Sun Java Application Server 9.0 but fails on JBoss 4.0.5-GA.
The (stripped down) entity beans:
@Entity
@Table(name = "RelMain")
public class RelMain
implements Serializable
{
private Long itsMainID;
private String itsMainText;
private Set<RelSub> itsSubs;
public RelMain(Long pMainID)
{
itsMainID = pMainID;
}
@Id
@Column(name = "MainID", nullable = false)
public Long getMainID()
{
return itsMainID;
}
public void setMainID(Long pMainID)
{
itsMainID = pMainID;
}
@Column(name = "MainText")
public String getMainText()
{
return itsMainText;
}
public void setMainText(String pMainText)
{
itsMainText = pMainText;
}
@OneToMany(mappedBy="main", cascade={CascadeType.REMOVE})
public Set<RelSub> getSubs()
{
return itsSubs;
}
public void setSubs(Set<RelSub> pSubs)
{
itsSubs = pSubs;
}
}
@Entity
@Table(name = "RelSub")
public class RelSub
implements Serializable
{
private Long itsMainID;
private String itsSubNo;
private int itsSubValue;
private RelMain itsMain;
public RelSub(Long pMainID, String pSubNo)
{
itsMainID = pMainID;
itsSubNo = pSubNo;
}
@Id
@Column(name = "MainID", nullable = false)
public Long getMainID()
{
return itsMainID;
}
public void setMainID(Long pMainID)
{
itsMainID = pMainID;
}
@Id
@Column(name = "SubNo", nullable = false)
public String getSubNo()
{
return itsSubNo;
}
public void setSubNo(String pSubNo)
{
itsSubNo = pSubNo;
}
@Column(name = "SubValue")
public int getSubValue()
{
return itsSubValue;
}
public void setSubValue(int pSubValue)
{
itsSubValue = pSubValue;
}
@ManyToOne
@JoinColumns({
@JoinColumn(name="MainID", insertable=false, updatable=false)
})
public RelMain getMain()
{
return itsMain;
}
public void setMain(RelMain pMain)
{
itsMain = pMain;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Resolved: (EJBTHREE-647) SecondaryTable
by Emmanuel Bernard (JIRA)
[ http://jira.jboss.com/jira/browse/EJBTHREE-647?page=all ]
Emmanuel Bernard resolved EJBTHREE-647.
---------------------------------------
Resolution: Won't Fix
Assignee: Emmanuel Bernard
Hibernate does not sipport JOINED and secondary table, you can do the equivalent mapping using SINGLE_TABLE and mapping the "JOINED" tables as secondary tables
> SecondaryTable
> --------------
>
> Key: EJBTHREE-647
> URL: http://jira.jboss.com/jira/browse/EJBTHREE-647
> Project: EJB 3.0
> Issue Type: Bug
> Components: EJB3 Extensions
> Affects Versions: EJB 3.0 RC8 - FD
> Environment: PC Intel 2.8GHz, 1G RAM, OpenSuSE 10.0, Eclipse 3.1.2, JBoss-IDE 1.5.1.GS, AS JBoss-4.0.4.GA
> Reporter: Jose Jesus
> Assigned To: Emmanuel Bernard
>
> I'm using @SecondaryTable annoration and at deploy moment an exception occurs:
> 10:10:46,141 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
> org.hibernate.AssertionFailure: Table PERSON not found
> at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:444)
> at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:225)
> at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:223)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
> at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
> at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
> at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:350)
> at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:119)
> at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
> :
> :
> 10:10:46,189 WARN [ServiceController] Problem starting service persistence.units:jar=sgscore-ejb3.jar,unitName=sgscore
> org.hibernate.AssertionFailure: Table PERSON not found
> at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:444)
> at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:225)
> at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
> at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:223)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1213)
> at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631)
> at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760)
> at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:350)
> at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:119)
> at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
> :
> :
> my code and annotations are:
> @Entity
> @Table(name="USER")
> @Inheritance(strategy = InheritanceType.JOINED)
> @SecondaryTable(name = "PERSON", pkJoinColumns = {
> @PrimaryKeyJoinColumn(name = "PERSON_ID", referencedColumnName = "ID")
> }
> )
> public class User extends Participant {
> private String firstName;
> :
> :
> @Column(name="FIRST_NAME", table="PERSON")
> public String getFirstName(){
> return firstName;
> }
> public void setFirstName(String firstName) {
> this.firstName = firstName;
> }
> :
> :
> }
> @Entity
> @Table(name="PERSON")
> public class Person {
> private String firstName;
> :
> :
> @Column(name="FIRST_NAME")
> public String getFirstName() {
> return firstName;
> }
> public void setFirstName(String firstName) {
> this.firstName = firstName;
> }
> :
> :
> }
> @Entity
> @Table(name="PARTICIPANT")
> @Inheritance(strategy = InheritanceType.JOINED)
> public class Participant {
> private String id;
> :
> :
> @Id
> public String getId() {
> return id;
> }
> public void setId(String id) {
> this.id = id;
> }
> :
> :
> }
> Another observation is that in User class SecondaryTable annotation I already try:
> @SecondaryTable(name="PERSON")
> AND
> @SecondaryTables({
> @SecondaryTable(name = "PERSON", pkJoinColumns = {
> @PrimaryKeyJoinColumn(name = "PERSON_ID", referencedColumnName = "ID")
> }
> )
> }
> )
> AND
> @SecondaryTables({
> @SecondaryTable(name = "PERSON")
> }
> )
> the same exception occurs.
> What's the problem with implementation code or annotations???
> Thank's.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Created: (EJBTHREE-694) @OneToOne relation fails, when foreign key is in inverse side
by Martin Isheim (JIRA)
@OneToOne relation fails, when foreign key is in inverse side
-------------------------------------------------------------
Key: EJBTHREE-694
URL: http://jira.jboss.com/jira/browse/EJBTHREE-694
Project: EJB 3.0
Issue Type: Bug
Components: EJB3 Extensions
Affects Versions: EJB 3.0 RC8 - FD
Environment: JBoss AS 4.0.4 GA3 with jboss-EJB-3.0_RC8-FD installed as described in the release.
Reporter: Martin Isheim
I defined a OneToOne relation from "UserEntity" to "PasswordEntity", with the foreign key in the "PasswordEntity" (for historical reasons).
With EntityManager.persist() the entities were inserted into the database, but the foreignKey column in "PasswordEntity" is empty.
Reading the "UserEntity" provides an empty relation.
Here the getter from "UserEntity":
<code>
private PasswordEntity password;
@OneToOne(optional = true, cascade = CascadeType.ALL)
@PrimaryKeyJoinColumn(name = "ENTITYKEY", referencedColumnName = "USERKEY")
public PasswordEntity getPassword() {
return password;
}
</code>
Since the relation is unidirectional, "PaswordEntity" has no getter/setter.
Regards.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months
[JBoss JIRA] Created: (EJBTHREE-684) Ejb3 deployer does not allow method overriding with Java 1.5 Covariant return types
by Swarn Dhaliwal (JIRA)
Ejb3 deployer does not allow method overriding with Java 1.5 Covariant return types
-----------------------------------------------------------------------------------
Key: EJBTHREE-684
URL: http://jira.jboss.com/jira/browse/EJBTHREE-684
Project: EJB 3.0
Issue Type: Bug
Affects Versions: EJB 3.0 RC8 - FD
Environment: Jboss-4.0.4.GA with ejb3 installed using the installer 'jboss-4.0.4.GA-Patch1-installer.jar'
Reporter: Swarn Dhaliwal
We have ejb3 entities which use method overiding with java 1.5 covariant return types. The code works correctly in jboss-4.0.4rc1 with ejb3 installed using the installer.
However when trying to deploy the same code in the aforementioned version a compilation exception is thrown indicating that there are duplicate methods in the class. The code looks like the following :
public abstract class AbstractEntity {
protected abstract Object getId();
}
public class ConcreteEntity extends AbstractEntity {
public String getId() {
return id;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years, 2 months