DB2 Plugin SQL Generation

2011-04-20 Thread Jeffrey Simpson
Thanks for the responses from my previous email DB2 Plugin testing.

I am working on the SQL Generation and so I looked at the sql generated from 
the MySql Plugin and the Postgress plugin.  I have a question related to PK 
generation support.  Here is a sample of the generated sql:

CREATE SEQUENCE Employee_seq;

CREATE TEMP TABLE EOF_TMP_TABLE AS SELECT SETVAL('Employee_seq', (SELECT 
MAX(id) FROM Employee));

DROP TABLE EOF_TMP_TABLE;

ALTER TABLE Employee ALTER COLUMN id SET DEFAULT nextval( 'Employee_seq' );


In the Create table and alter table scripts there is are 2 function calls  
setval and nextval.  Are these user defined functions?  If they are are there 
any examples?



Jeffrey Simpson
Senior Software Engineer
Telephone: 240.235.2144
Fax: 240.235.2174
simp...@yfu.org

Youth For Understanding (YFU) prepares young people for their responsibilities 
and opportunities in a changing, interdependent world.
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: DB2 Plugin SQL Generation

2011-04-20 Thread Chuck Hill
Hi Jeffrey,


On Apr 20, 2011, at 11:13 AM, Jeffrey Simpson wrote:

> Thanks for the responses from my previous email DB2 Plugin testing.
> 
> I am working on the SQL Generation and so I looked at the sql generated from 
> the MySql Plugin and the Postgress plugin.  I have a question related to PK 
> generation support.  Here is a sample of the generated sql:
> 
> CREATE SEQUENCE Employee_seq;
> 
> CREATE TEMP TABLE EOF_TMP_TABLE AS SELECT SETVAL('Employee_seq', (SELECT 
> MAX(id) FROM Employee));
> 
> DROP TABLE EOF_TMP_TABLE;
> 
> ALTER TABLE Employee ALTER COLUMN id SET DEFAULT nextval( 'Employee_seq' );
> 
> In the Create table and alter table scripts there is are 2 function calls  
> setval and nextval.  Are these user defined functions?  If they are are there 
> any examples?


I think those are db specific.  You need to figure out what you want it to emit 
for DB2, then look at 
com.webobjects.eoaccess.synchronization.EOSchemaSynchronizationFactory

You will want a sub-class of this in your plugin, see public 
EOSchemaSynchronizationFactory createSchemaSynchronizationFactory() in 
JDCBPlugin.  You can override the methods to produce appropriate SQL for DB2.


Chuck

-- 
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects









smime.p7s
Description: S/MIME cryptographic signature
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Session EC Exception

2011-04-20 Thread Ken - Watermark Studios
So, I have over 4000 user objects related to about 20 country objects. I had
a few duplicate countries in the country table because of record imports.
So, I wrote a quick direct action that allows me to merge the countries.
Basically, there are two drop-down lists, each with the full country list
(including duplicates). I can select two different country objects and the
page moves all users of the first selected country to the second selected
country.

Here's the problem. I've been successful merging almost every country to the
appropriate country. The successful merges have had between 1-500 user
objects to move. When I was trying to move USA related users to United
States, 900 records successfully move, but I get the following error for
over 200 records.

"er.transaction.adaptor.Exceptions  - Database Exception occured:
com.webobjects.eoaccess.EOGeneralAdaptorException:
updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in
database

updateValuesInRowDescribedByQualifier --
com.webobjects.jdbcadaptor.JDBCChannel method failed to update row in
database"



Where should I start looking to resolve? I've compared the data from objects
that successfully transferred against those that didn't transfer and I'm not
seeing a clear pattern.



Thanks,



Ken


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com