On a recent project we were using DBSequence for PK sequencing, but we had nothing but trouble with them:
- DBSequence PK can't be directly used in LOV, as DBSequence can't be assigned to an Integer field
- No matter what we did we couldn't get around »could not fould the owning Entity...« error in one case; interesting enough, the same use case worked on a simple adf page, but not in bounded TF jsff
So we were discussing good reasons to use DBSequence and.. we came up with nothing. Well, among the ideas were:
1. DBSequence prevents gap in sequencing
Which is NOT TRUE, a transaction can start by inserting master record, getting sequence from DB and fails while inserting detail record(s) – and there's a gap in your sequencing
2. DBSequence does not require an extra roundtrip to the DB when a record is created
Which is an interesting point, but we came up with an idea to implement:
- s sequence on a db layer which is incremented lat's say by 100
- a singleton which reads next sequence from DB, but then assigns values from the memory
- base entity to implement reading from the singleton
So right now I see no benefit of using DBSequence whatsoever, it's just a source of potential problems. Are we missing something?
Thanks
Jernej
if (PropertyDefaultContext.getInstance().getDirect(PropertyMetadata.ENV_ROWID_AM_DS_NAME.pName) == null){PropertyDefaultContext.getInstance().setDirect(PropertyMetadata.ENV_ROWID_AM_DS_NAME.pName,"java:comp/env/jdbc/YourDatasourceDS");
}
--
You received this message because you are subscribed to the ADF Enterprise Methodology Group (http://groups.google.com/group/adf-methodology). To unsubscribe send email to adf-methodolo...@googlegroups.com
All content to the ADF EMG lies under the Creative Commons Attribution 3.0 Unported License (http://creativecommons.org/licenses/by/3.0/). Any content sourced must be attributed back to the ADF EMG with a link to the Google Group (http://groups.google.com/group/adf-methodology).
Very interesting helper thanks, but from what I see the main purpose is to have a cross-db sequencing, right?
If target DB is Oracle, then a simpler approach should be OK. I'm faimilliar with DBSequence, but in practice it seems to create more problems than it solves.