[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2508) Missing sequence or table on Oracle
André Fernandes (JIRA)
noreply at atlassian.com
Tue Jun 5 14:21:04 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27142 ]
André Fernandes commented on HHH-2508:
--------------------------------------
After a little thinking, I find out that there is no need to put the SEQUENCE_OWNER='YYYYYY' on the method.
If the method becomes just
package org.hibernate.dialect;
public class Oracle9Dialect extends Dialect {
......
......
public String getQuerySequencesString() {
return "select sequence_name from all_sequences";
}
instead of "select sequence_name from user_sequences"
then, it will work just great when a user access other schemas
after all, the sequences that are used can be anyone in the all_sequences, i.e., from all the schemas the user has access.
> Missing sequence or table on Oracle
> -----------------------------------
>
> Key: HHH-2508
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2508
> Project: Hibernate3
> Issue Type: Patch
> Components: core
> Environment: JBoss 4.0.5.GA, Using JBoss SEAM and Oracle 9i, EJB/JPA annotations
> Reporter: André Fernandes
> Assignee: Steve Ebersole
>
> Here we use a user "project_web" to access a "dbproject" schema.
> The problem is, when Hibernate looks for the sequences, it looks in the user_sequences, but my user (project_web) don't have any sequences.
> The solving is: when getting the sequence names (org.hibernate.dialect.Oracle9Dialect .getQuerySequencesString) use that:
> select SEQUENCE_NAME from all_sequences where SEQUENCE_OWNER='DBPROJECT'
> i.e. use the schema to look in the all_sequences.
> Sorry for the bad english.
> package org.hibernate.dialect;
> public class Oracle9Dialect extends Dialect {
> public String getQuerySequencesString() {
> return "select sequence_name from user_sequences";
> }
> @GeneratedValue(generator="sqCoSeqProjeto", strategy=GenerationType.SEQUENCE)
> @SequenceGenerator(name="sqCoSeqProjeto", sequenceName="sq_coseqprojeto", allocationSize=5)
--
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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list