Abel Birya | 18 Apr 2011 07:50
Picon

SINSERT Key Generator [1 Attachment]

Hi,

I was wondering whether anyone has been able to do an implementation of this key generator mode for MySQL. I implemented the methods supportsInsertKeyGeneration() & retrieveInsertKey() of the SDriverMySQL.java class and so far I am able to retrieve my inserted key from the db when a commit() is done.

One thing that I have noticed though is that in the event that an entity represents a foreign key in another table, I have to explicitly call the session.flush() method in order for the entity to bear its primary key field value before I call the setReference() method in the child record.

I was wondering whether there is anyone who has time to assist me in testing this. I am currently working on a project that needs to work in a multi-threaded environment where there will be many connections to the DB at once and I wanted to find out how effective the retrieveInsertKey() method is going to be in such an environment and whether I will be able to maintain data integrity all across the different threads that are running.

I have attached the SDriverMySQL.java class.

Kind regards.

Abel


Attachment(s) from Abel Birya

1 of 1 File(s)


__._,_.___

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Gmane