Discussion:
[Middlegen-user] Oracle Sequences
Perchonok, David
2003-01-28 19:36:03 UTC
Permalink
Can anyone enlighten me how to specify automatic key generation for Oracle
sequences? Our toolset is Weblogic and Oracle. It seems as though we should
be usng the 'oracleSequence' optional element for the cmp20 task ... but the
documentation does not clearly specify how to associate a column to a
particular Oracle sequence.

Many thanks -

David Perchonok
Software Design and Development
Bank of America - CRM Services
Email: ***@bankofamerica.com
Rod Macpherson
2003-01-28 19:56:09 UTC
Permalink
Use the weblogic sub-task versus oracleSequence. Specify VENDOR_SEQ as
pkgen value and the name of the Oracle sequence as the generatorName.
The oracleSequence deal will work but I believe you have to supply a
table with a single numeric column in that case.


-----Original Message-----
From: Perchonok, David [mailto:***@bankofamerica.com]
Sent: Tuesday, January 28, 2003 1:35 PM
To: middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] Oracle Sequences


Can anyone enlighten me how to specify automatic key generation for
Oracle sequences? Our toolset is Weblogic and Oracle. It seems as though
we should be usng the 'oracleSequence' optional element for the cmp20
task ... but the documentation does not clearly specify how to associate
a column to a particular Oracle sequence.

Many thanks -

David Perchonok
Software Design and Development
Bank of America - CRM Services
Email: ***@bankofamerica.com


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
middlegen-user mailing list middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Matthias Flor
2003-01-29 16:59:09 UTC
Permalink
Post by Rod Macpherson
Use the weblogic sub-task versus oracleSequence. Specify VENDOR_SEQ as
pkgen value and the name of the Oracle sequence as the generatorName.
If you have Weblogic use their mechanism to generate PK.
We used it once with XDoclet and it worked well.
Post by Rod Macpherson
The oracleSequence deal will work but I believe you have to supply a
table with a single numeric column in that case.
FYI:
The oraclesequence needs for each table a sequence. The sequence name
is assumed to be the SQL-table-name suffixed by _SEQ if not stated
otherwise in the sequencename-Attribute in the <table>-Element.
Be sure not to have sequences that are longer than 30 characters.
The oraclesequence-Element takes one subelement: The datasource, which
must be the same as in the <jboss/> or <weblogic/> subtask.
The generated OracleSequenceSessionBean runs a simple
select seq_name.nextVal from dual;
to get the next primarykey.

The oraclesequence-Task was implemented to bypass the limitation
of JBoss with Oracle-Sequences.

HTH,
Matthias
Perchonok, David
2003-01-28 22:42:03 UTC
Permalink
Rod -

Thanks for your message. Based upon your input, the weblogic subtask would
appear as the following:

<weblogic pkgen="VENDOR_SEQ" generatorName="DEAL_SEQ"
keyCacheSize="1"/>

But how would this be associated back to a table/bean?

David Perchonok
Software Design and Development
Bank of America - CRM Services
Email: ***@bankofamerica.com

====================================

From: Rod Macpherson <***@ve...>
</mailarchive/message.php?msg_id=3654630>
RE: Oracle Sequences </mailarchive/message.php?msg_id=3654630>
2003-01-28 16:55

Use the weblogic sub-task versus oracleSequence. Specify VENDOR_SEQ as

pkgen value and the name of the Oracle sequence as the generatorName.
The oracleSequence deal will work but I believe you have to supply a
table with a single numeric column in that case.


-----Original Message-----
From: Perchonok, David [mailto:***@ba...]
Sent: Tuesday, January 28, 2003 1:35 PM
To: middlegen-***@li...
Subject: [Middlegen-user] Oracle Sequences

Can anyone enlighten me how to specify automatic key generation for

Oracle sequences? Our toolset is Weblogic and Oracle. It seems as
though
we should be usng the 'oracleSequence' optional element for the
cmp20
task ... but the documentation does not clearly specify how to
associate
a column to a particular Oracle sequence.

Many thanks -

David Perchonok
Software Design and Development
Bank of America - CRM Services
Email: ***@ba...
-------------------------------------------------------
Rod Macpherson
2003-01-28 23:18:09 UTC
Permalink
I am not using this, however, this is what should happen. Middlegen will
create beans with the following tags:

*
* @weblogic:automatic-key-generation
* generator-type="ORACLE"
* generator-name="FOOBAR_SEQUENCE"
* key-cache-size="1"
*

XDoclet will apply advanced fuzzy-neural-network technology to generate
the following in weblogic-cmp-rdbms.xml:

<automatic-key-generation>
<generator-type>ORACLE</generator-type>
<generator-name>FOOBAR_SEQUENCE</generator-name>
<key-cache-size>1</key-cache-size>
</automatic-key-generation>

(Note: key-cache-size MUST equal the sequence's increment which by
default is 1)

So the binding is done on a bean-by-bean basis, that is, on a
table-by-table basis.


-----Original Message-----
From: Perchonok, David [mailto:***@bankofamerica.com]
Sent: Tuesday, January 28, 2003 4:41 PM
To: middlegen-***@lists.sourceforge.net
Subject: [Middlegen-user] RE: Oracle Sequences


Rod -

Thanks for your message. Based upon your input, the weblogic subtask
would appear as the following:

<weblogic pkgen="VENDOR_SEQ" generatorName="DEAL_SEQ"
keyCacheSize="1"/>

But how would this be associated back to a table/bean?

David Perchonok
Software Design and Development
Bank of America - CRM Services
Email: ***@bankofamerica.com

====================================

From: Rod Macpherson <***@ve...>
</mailarchive/message.php?msg_id=3654630>
RE: Oracle Sequences </mailarchive/message.php?msg_id=3654630>
2003-01-28 16:55

Use the weblogic sub-task versus oracleSequence. Specify VENDOR_SEQ
as

pkgen value and the name of the Oracle sequence as the
generatorName.
The oracleSequence deal will work but I believe you have to supply
a
table with a single numeric column in that case.


-----Original Message-----
From: Perchonok, David [mailto:***@ba...]
Sent: Tuesday, January 28, 2003 1:35 PM
To: middlegen-***@li...
Subject: [Middlegen-user] Oracle Sequences

Can anyone enlighten me how to specify automatic key generation
for

Oracle sequences? Our toolset is Weblogic and Oracle. It seems
as though
we should be usng the 'oracleSequence' optional element for the
cmp20
task ... but the documentation does not clearly specify how to
associate
a column to a particular Oracle sequence.

Many thanks -

David Perchonok
Software Design and Development
Bank of America - CRM Services
Email: ***@ba...
-------------------------------------------------------




-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
middlegen-user mailing list middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Eivind Waaler
2003-01-29 06:18:03 UTC
Permalink
I did some testing on the weblogic pkgen stuff. The NAMED_SEQUENCE_TABLE
strategy seems not to be working, due to the following change in the code:

http://tinyurl.com/51a0

I'll log a bug report on this.

However for the VENDOR_SEQ with Oracle, this should work (I have no Oracle
to test on). However if you only want to generate for some specified
tables, I guess we'd need some kind of generatePk flag on the <table>
element? Does that sound reasonable? Right now I think the tag will be
inserted for all beans with simple (Integer?) primary keys.

.eivind
Post by Rod Macpherson
I am not using this, however, this is what should happen. Middlegen will
*
* generator-type="ORACLE"
* generator-name="FOOBAR_SEQUENCE"
* key-cache-size="1"
*
XDoclet will apply advanced fuzzy-neural-network technology to generate
<automatic-key-generation>
<generator-type>ORACLE</generator-type>
<generator-name>FOOBAR_SEQUENCE</generator-name>
<key-cache-size>1</key-cache-size>
</automatic-key-generation>
(Note: key-cache-size MUST equal the sequence's increment which by
default is 1)
So the binding is done on a bean-by-bean basis, that is, on a
table-by-table basis.
-----Original Message-----
Sent: Tuesday, January 28, 2003 4:41 PM
Subject: [Middlegen-user] RE: Oracle Sequences
Rod -
Thanks for your message. Based upon your input, the weblogic subtask
<weblogic pkgen="VENDOR_SEQ" generatorName="DEAL_SEQ"
keyCacheSize="1"/>
But how would this be associated back to a table/bean?
David Perchonok
Software Design and Development
Bank of America - CRM Services
====================================
</mailarchive/message.php?msg_id=3654630>
RE: Oracle Sequences </mailarchive/message.php?msg_id=3654630>
2003-01-28 16:55
Use the weblogic sub-task versus oracleSequence. Specify VENDOR_SEQ
as
pkgen value and the name of the Oracle sequence as the
generatorName.
The oracleSequence deal will work but I believe you have to supply
a
table with a single numeric column in that case.
-----Original Message-----
Sent: Tuesday, January 28, 2003 1:35 PM
Subject: [Middlegen-user] Oracle Sequences
Can anyone enlighten me how to specify automatic key generation
for
Oracle sequences? Our toolset is Weblogic and Oracle. It seems
as though
we should be usng the 'oracleSequence' optional element for the
cmp20
task ... but the documentation does not clearly specify how to
associate
a column to a particular Oracle sequence.
Many thanks -
David Perchonok
Software Design and Development
Bank of America - CRM Services
Rod Macpherson
2003-01-29 14:46:02 UTC
Permalink
Put the tables that use the auto-sequence in a separate table list and run a parameterized or another ant target.

-----Original Message-----
From: Eivind Waaler [mailto:***@tihlde.org]
Sent: Wed 1/29/2003 12:17 AM
To: middlegen-***@lists.sourceforge.net
Cc:
Subject: RE: [Middlegen-user] RE: Oracle Sequences



I did some testing on the weblogic pkgen stuff. The NAMED_SEQUENCE_TABLE
strategy seems not to be working, due to the following change in the code:

http://tinyurl.com/51a0

I'll log a bug report on this.

However for the VENDOR_SEQ with Oracle, this should work (I have no Oracle
to test on). However if you only want to generate for some specified
tables, I guess we'd need some kind of generatePk flag on the <table>
element? Does that sound reasonable? Right now I think the tag will be
inserted for all beans with simple (Integer?) primary keys.

.eivind
Post by Rod Macpherson
I am not using this, however, this is what should happen. Middlegen will
*
* generator-type="ORACLE"
* generator-name="FOOBAR_SEQUENCE"
* key-cache-size="1"
*
XDoclet will apply advanced fuzzy-neural-network technology to generate
<automatic-key-generation>
<generator-type>ORACLE</generator-type>
<generator-name>FOOBAR_SEQUENCE</generator-name>
<key-cache-size>1</key-cache-size>
</automatic-key-generation>
(Note: key-cache-size MUST equal the sequence's increment which by
default is 1)
So the binding is done on a bean-by-bean basis, that is, on a
table-by-table basis.
-----Original Message-----
Sent: Tuesday, January 28, 2003 4:41 PM
Subject: [Middlegen-user] RE: Oracle Sequences
Rod -
Thanks for your message. Based upon your input, the weblogic subtask
<weblogic pkgen="VENDOR_SEQ" generatorName="DEAL_SEQ"
keyCacheSize="1"/>
But how would this be associated back to a table/bean?
David Perchonok
Software Design and Development
Bank of America - CRM Services
====================================
</mailarchive/message.php?msg_id=3654630>
RE: Oracle Sequences </mailarchive/message.php?msg_id=3654630>
2003-01-28 16:55
Use the weblogic sub-task versus oracleSequence. Specify VENDOR_SEQ
as
pkgen value and the name of the Oracle sequence as the
generatorName.
The oracleSequence deal will work but I believe you have to supply
a
table with a single numeric column in that case.
-----Original Message-----
Sent: Tuesday, January 28, 2003 1:35 PM
Subject: [Middlegen-user] Oracle Sequences
Can anyone enlighten me how to specify automatic key generation
for
Oracle sequences? Our toolset is Weblogic and Oracle. It seems
as though
we should be usng the 'oracleSequence' optional element for the
cmp20
task ... but the documentation does not clearly specify how to
associate
a column to a particular Oracle sequence.
Many thanks -
David Perchonok
Software Design and Development
Bank of America - CRM Services
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
middlegen-user mailing list
middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user
Rod Macpherson
2003-01-29 17:11:01 UTC
Permalink
OK, so the oracleSequence sub-task is sans weblogic and requires a
sequence for each table with the _SEQ suffix (that is precisely what we
have in fact) and it will generate the code independent of the
application server. The weblogic sub-task provides the same
functionality (that is what I recommended he use) but he does not have
Oracle setup yet (360 terabyte download:) but that should work for him.
Thanks for clarifying the oracleSequence.

-----Original Message-----
From: Matthias Flor [mailto:***@isb-ag.de]
Sent: Wednesday, January 29, 2003 10:59 AM
To: middlegen-***@lists.sourceforge.net
Subject: Re: [Middlegen-user] Oracle Sequences
Post by Rod Macpherson
Use the weblogic sub-task versus oracleSequence. Specify VENDOR_SEQ as
pkgen value and the name of the Oracle sequence as the generatorName.
If you have Weblogic use their mechanism to generate PK.
We used it once with XDoclet and it worked well.
Post by Rod Macpherson
The oracleSequence deal will work but I believe you have to supply a
table with a single numeric column in that case.
FYI:
The oraclesequence needs for each table a sequence. The sequence name is
assumed to be the SQL-table-name suffixed by _SEQ if not stated
otherwise in the sequencename-Attribute in the <table>-Element. Be sure
not to have sequences that are longer than 30 characters. The
oraclesequence-Element takes one subelement: The datasource, which must
be the same as in the <jboss/> or <weblogic/> subtask. The generated
OracleSequenceSessionBean runs a simple
select seq_name.nextVal from dual;
to get the next primarykey.

The oraclesequence-Task was implemented to bypass the limitation of
JBoss with Oracle-Sequences.

HTH,
Matthias





-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
middlegen-user mailing list middlegen-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/middlegen-user

Loading...