Another user changed the primary key
am using jdev 11.1.1.5.0-adfbc
after each and every insert while saving the record
error throws like this >>>Another user changed the primary key
what should i do to avoid this?
<?xml version = '1.0' encoding = 'UTF-8'?>
<BC4JConfig version="11.1" xmlns="http://xmlns.oracle.com/bc4j/configuration">
<AppModuleConfigBag ApplicationName="com.rits.glm.model.servicesAM.generalLedgerAM">
<AppModuleConfig DeployPlatform="LOCAL" JDBCName="goodwell" jbo.default.country="IN" jbo.project="com.rits.glm.GeneralLedger" name="generalLedgerAMLocal" ApplicationName="com.rits.glm.model.servicesAM.generalLedgerAM">
<Database jbo.locking.mode="optimistic"/>
<Security AppModuleJndiName="com.rits.glm.model.servicesAM.generalLedgerAM"/>
</AppModuleConfig>
<AppModuleConfig DeployPlatform="LOCAL" JDBCName="goodwell" jbo.default.country="IN" jbo.project="com.rits.glm.GeneralLedger" name="generalLedgerAMShared" ApplicationName="com.rits.glm.model.servicesAM.generalLedgerAM">
<AM-Pooling jbo.ampool.dynamicjdbccredentials="false" jbo.ampool.isuseexclusive="false" jbo.ampool.maxpoolsize="1" jbo.ampool.resetnontransactionalstate="false"/>
<Database jbo.locking.mode="optimistic"/>
<Security AppModuleJndiName="com.rits.glm.model.servicesAM.generalLedgerAM"/>
</AppModuleConfig>
</AppModuleConfigBag>
</BC4JConfig>
some suggestions
JBO-25014: Another user has changed...
http://adfhowto.blogspot.com/2010/12/troubleshooting-another-user-has.html
Another user has changed the row with Primary key
Similar Messages
-
ER. about RowInconsistentException: JBO-25014:Another user Changed the Row
there is a default value in a columns.
is couses RowInconsistentException: JBO-25014:Another user Changed the Row when we insert then uptede a record.
if ADF entity object wizard can take default value from database columns (as default) this error can be prevented before occurring.ali,
Agree that this would be a nice feature.
To work around the problem (JBO-25014) - does it go away if you set the property of that attribute to refresh after insert?
Best,
John -
Setting the "primary key" possible?
We are trying to access an existing database using Kodo JDO. A part of
this database is old and not particularly well-designed.
Some tables does not have a primary key, eventhough they are entities that
need to be mapped to classes in our persistence layer. For the one table
we are looking at currently, we have changeed a unique index on a numeric
field to be the primary key, simply to make things work.
The table (x) is extremely simple:
id number
description varchar
We have defined the table as having application identity since the user
wants to control the values of the id column. In fact, he would like to be
able to update the value, as long as no other records in the system refers
to the record via a foreign key.
When updating the record we get a kodo.util.UserException saying that
changing the primary key is illegal for persisted objects.
This is of course reasonable seen from JDO, but in our old user interface,
it was possible to change this id as long as it was not referred to.
Is there any other way out of this than to add an "internalID" column with
datastore identify, make that the primary key and then have the id column
have a unique database constraint instead?? We would prefer to not change
the database schema, but are willing to if absolutely necessary.Is there any other way out of this than to add an "internalID" column with
datastore identify, make that the primary key and then have the id column
have a unique database constraint instead?? We would prefer to not change
the database schema, but are willing to if absolutely necessary.Well, I guess you could do the following:
- Set some unmanaged field to the desired new pk value.
- Use a custom class mapping (probably extending
kodo.jdbc.meta.BaseClassMapping) to change the pk column on updates based on the
value of the unmanaged field.
It's not trivial, but it at least avoids schema changes. Note that it will only
work correctly if you have very short-lived PersistenceManagers, though. Once a
transaction that changes a pk value commits, the PM cache will be invalid; Kodo
will still think the object has its old pk value. You also couldn't use the
DataCache. -
Modify the value of the primary key...
Hi all,
I have made a mistake in the design of the table......
and it is too late to get it changed....
I have set the wrong field as primary key...
These fields (keys) need to be modify , since i ve set it as a key, when ever modify those fields using
"MODIFY ZTABLE VALUE INT_TABLE . ", it create a new row into the table because i change the primary key value. Using "UPDATE ZTABLE ....." it doesnt works because the key's value has changed.
Thank you very much friends...Hi Wong,
If the primary key value does not exist then MODIFY statement creates a new record and if exists it modifies(updates)...
So better change the Table Primary key and try to reapeat u r code...
For changing the primary key just goto SE11 and just check the primary key which u want to assign and uncheck the preivous one ( make sure the primary key on to first line) then save it and before activating goto<b> Utilities --> Database Utility --> activate and adjust database</b>
Now u r table is activated without deleting previous data also...
Regards,
Sridhar -
i've got a ton of users, whose primary group is "current student". they all belong to the other group "year 13"
they've left school, so i thought it would be easy to do a search of users with GID equal to or containing the GID for "year 13" (in this case 1121) and then change their primary group to "left school"
except that doesn't work. i can only search for them in WGM by primary group, it seems. therefore i cannot do any batch operations on a secondary group.
so. how do i do this? is there a way of scripting dcsl to find users by 'other group' and then change the primary group attribute?
i'm going to need to be doing a lot of this (changing the other gropus of a school full of students). bit stumped.
help!ok. for some reason neitehr root nor my account (which is part of the open directory admin group) can make changes using dscl.
when addingremoving users from groups, remember that teh UUID has to be added/removed too
this is getting there:
old=year11
new=year12
for item in `dscl /LDAPv3/127.0.0.1/ read /Groups/$old GroupMembership | cut -d: -f2`
do
echo $item
UUID=`dsmemberutil getuuid -U $item`
case "$UUID"
in
"There is no uuid for user $item")
echo "user $item need personal attention"
dscl -u diradmin -P 'somepassword' /LDAPv3/127.0.0.1 append /Groups/$new GroupMembership $item
dscl -u diradmin -P 'somepassword' /LDAPv3/127.0.0.1 append /Groups/$new GroupMembers $UUID
if [ "`dsmemberutil checkmembership -U $item -G $new`" == "user is a member of the group" ] ; then
echo "$item added to $new"
dscl -u diradmin -P 'somepassword' /LDAPv3/127.0.0.1 delete /Groups/$old GroupMembership $item
dscl -u diradmin -P 'somepassword' /LDAPv3/127.0.0.1 delete /Groups/$old GroupMembers $UUID
if [ "`dsmemberutil checkmembership -U $item -G $old`" == "user is a member of the group" ] ; then
echo "removal of $item from $old failed"
else
echo "removal of $item from $old succeded"
fi
else echo "append of $item to $new failed"
fi
esac
done -
DBMS_CDC find only the columns that are changed along with the primary key in the table
Hello,
We are having a requirement to find the change data in the production environment.
We are planning to use the DBMS_CDC utility.
But for example in the create change table 1 picked emp_id,ename, address, salary,dob.
I have a sample data of
empid
ename
address
salary
DOB
1
test1
24 test street
2000
20-Jan-98
2
test2
25 test street
2500
15-Aug-97
if ename for empid 1 is changed to test1_test3 from test1.
My CDC is capturing the values in the old and new values in the 5 columns.
But i need to get only the empid (primary key of the source table) and the ename column as only that's been updated not the rest of the 3 columns.
Can i accomplish this.
Please advice.Hello,
Thanks for the information.
but if i change the change table then i will miss the other columns right?
I want to get the columns( empid and ename) only if ename is changed. i.e when ever any column in emp table changes i need to get all the columns where the data is changed along with the primary key columns empid.
Is there any way i can tweak the parameters so that i can achieve this or is there any other way using the cdc i can get this data.
Thanks -
How do you change the value of the primary key in the CMP?
Hi,
The cmp that I built has the phone as the Prikey field.
The bean has the get/set methods. The servlet invokes the cmp
to change the phone number. How could I do that?
The setXXX for the priKey can not be called outside of the ejbCreate() so
how would I change the prikey value of a particular row of the table. Do I have
to remove the bean then create the new bean with the new priKey value?
Please help,
ThanksThanks Mona
Tom.
Mona Ramlawi <[email protected]> wrote:
Hi TOM,
The primary key is the unique identifier of an Entity Bean.
To change it, you have to remove the bean instance = database delete
then you have to create a new one with the new primary-key value =
database insert.
Hard luck tom, maybe you should consider changing your primary key. You
can easily change it to an AutoNum
Tom wrote:
Hi,
The cmp that I built has the phone as the Prikey field.
The bean has the get/set methods. The servlet invokes the cmp
to change the phone number. How could I do that?
The setXXX for the priKey can not be called outside of the ejbCreate()so
how would I change the prikey value of a particular row of the table.Do I have
to remove the bean then create the new bean with the new priKey value?
Please help,
Thanks -
SDO gives JBO-26030: Failed to lock the record, another user holds the lock
Hi,
I have a question thats on the boundary between ADF and BPEL but I posted in this forum because its highly related to ADF Model with Service Interface.
We have a BPEL batch process that spawns multiple child BPEL processes that handle threads inside the batch in parallel. These child processes all update the same batch record in a database with for example the lastActionDateTime. We do this by invoking an update service on a SDO application that we built following this tutorial: http://jianmingli.com/wp/?p=2838
It all works good but sometimes when updating the same row from multiple BPEL process instances at the same time, we sometimes get a SDO JBO-26030: Failed to lock the record, another user holds the lock.
I'm a bit stunned by this, because all we really do is updating a record. From BPEL we just invoke the updateBatch webservice method of the Service Interface.
I can imagine that there will be wait time when these updates come in at the same time, but I didn't expect an exception would occur. Also the arbitrariness confuses me. If a child process would lock the record, I would expect this error to happen always and not at random.
From BPEL the error displays as follows:
<fault>
<bpelFault>
<faultType>1</faultType>
<ServiceException>
<part name="ServiceErrorMessage">
<tns:ServiceErrorMessage>
<tns:code>26030</tns:code>
<tns:message>JBO-26030: Failed to lock the record, another user holds the lock.</tns:message>
<tns:severity>SEVERITY_ERROR</tns:severity>
<tns:exceptionClassName>oracle.jbo.AlreadyLockedException</tns:exceptionClassName>
</tns:ServiceErrorMessage>
</part>
</ServiceException>
</bpelFault>
</fault>However when I dive into soa_server1-diagnostic.log I see the following exception:
[2011-10-28T17:37:37.770+02:00] [soa_server1] [ERROR] [] [oracle.jbo.server.svc.ServiceJTATxnHandlerImpl] [tid: [ACTIVE].ExecuteThread: '8' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: a1484c49db38e963:-581f01fc:13345d7173d:-8000-00000000000322f4,0:1:0x5f5e2bf:33] [WEBSERVICE_PORT.name: ECMControllerSDOServiceSoapHttpPort] [APP: ECMControllerSDO] [composite_name: ECMProcessController] [component_name: ProcessControllerBPEL] [component_instance_id: 240335] [J2EE_MODULE.name: ECMControllerSDO] [WEBSERVICE.name: ECMControllerSDOService] [J2EE_APP.name: ECMControllerSDO] [[
oracle.jbo.RowInconsistentException: JBO-25014: Another user has changed the row with primary key oracle.jbo.Key[CDS_20111028_8 ].
at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:1077)
at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:553)
at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8134)
at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:5863)
at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6369)
at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6551)
at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3275)
at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3078)
at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2088)
at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2369)
at oracle.jbo.server.DefaultJTATxnHandlerImpl.commit(DefaultJTATxnHandlerImpl.java:156)
at oracle.jbo.server.svc.ServiceJTATxnHandlerImpl.commit(ServiceJTATxnHandlerImpl.java:216)
at oracle.jbo.server.svc.ServiceJTATxnHandlerImpl.beforeCompletion(ServiceJTATxnHandlerImpl.java:124)
at sun.reflect.GeneratedMethodAccessor2677.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.jbo.server.svc.WLSContextCrossAppProxy$WLSCrossAppProxy.invoke(WLSContextCrossAppProxy.java:66)
at $Proxy377.beforeCompletion(Unknown Source)
at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1239)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1214)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:116)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1316)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2132)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:272)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:239)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:625)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
at nl.kpn.ecm4crm.am.server.serviceinterface.ECMControllerSDOServiceImpl_51vl7y_ECMControllerSDOServiceImpl.updateBatches(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
at $Proxy373.updateBatches(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.j2ee.ws.server.jaxws.ServiceEndpointRuntime.processMessage(ServiceEndpointRuntime.java:355)
at oracle.j2ee.ws.server.jaxws.ServiceEndpointRuntime.processMessage(ServiceEndpointRuntime.java:196)
at oracle.j2ee.ws.server.jaxws.JAXWSRuntimeDelegate.processMessage(JAXWSRuntimeDelegate.java:479)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:1187)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:1081)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:581)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:232)
at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:192)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:459)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.jbo.server.svc.ServiceContextFilter.doFilter(ServiceContextFilter.java:78)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)Thank you for reading, any directions suggestions on how to solve this will be highly appreciated.
regards,
GerbenThanks Frank.
Already tried that , please let me know if there is any other way to get this .
This is being discussed here :
Re: Update without No wait
and i am following what John Stegeman has suggested. -
Parameters in Url..how do I use login information to insert the primary key
Uggg, it is 3 am, I am so tired. Please help.
I have made a registration page for my site. Hurray it works.
Login Page. It works
Protected some pages. Works
Now I am trying to make a page that the users can go to and update their user information. User name, password, email ect.
I can get it to prepopulate if I put ?id=3, or someother primary key in the url by hand.....and it does update the data.... but I can't, for the life of me, figure out how to make it use the users login information to get and insert the primary key in the url from the link to the update page.
I have used the hyperlink box and chose the updateaccount.php file, then went to parameters and selected Name: id Value: I chose id from the dropdown from the data base. This puts in an echo that looks like it should work. NO SUCH LUCK.
Pleeeese!!! What am I doing wrong.
I am a total novice. Done a few static sites. So please speak slowly.
Thanks sooooo muchI really can´t recommend exposing critical stuff like e.g. the user´s login_id in the URL, because once it´s visible, it can be changed by anyone. Better insert the Session Variable kt_login_id, which will only be availabe on a custom PHP page when inserting...
<?php session_start(); ?>
...on line 1 of this document.
Cheers,
Günter -
One of our customers is moving from our application (which uses Advantage Database Server) to another application (which uses other database technology). They have asked us to help export their data, so that they can migrate it to another database system. So far, we have used the Advantage Data Architect (ARC32) "Export Table Structures as Code" functionality to generate SQL. We used the "Include existing data" option. The SQL contains the necessary code to recreate the tables and indexes. The customer's IT staff will alter the SQL statements as necessary for their new system.
However, there is an issue with the Primary Keys in these table. The resulting INSERT statements use AutoInc as the type for the Primary Key in each Table. These INSERT statements contains "DEFAULT" for the value of each of these AutoInc fields. The customer would like to output an integer value for each of these Primary Key values in order to maintain referential integrity in their new system.
So far, I have not found any feature of ARC32 that allows us to export the Primary Key values. We had been using an older version of ARC32, since our application does not use the latest version of ADS. I did download the latest version of ARC32 (11.10), but it does not appear to include any new functionality that would facilitate doing this sort of export.
Can somebody tell me if there is such a feature in ARC32?
Or, is there is another Advantage tool to facilitate what we are trying to accomplish?
If there are no Advantage tools to provide such functionality, what else would you suggest?George,
It sounds like the approach you are using is the correct one. This seems to be the cleanest solution to me especially since the customer is able to modify the generated SQL statements for their new system.
In order to preserve the AutoInc values I would recommend altering the table and changing the field datatype from AutoInc to Integer. Then export the table as code which will export the actual values. After the tables have been created on the new system they can change the field datatype back to an AutoInc type if necessary.
Regards,
Chris Franz -
Error while creating the Unique Index of the Primary Key of an Item
Hi all,
I have deployed a new item (CO_CONTRACTUNIT_PRODUCT) in my publication. The deploy appears to be successfull as the item can be seen in the repository through the Mobile Manager.
The problem occurs when i sync my local DB to get the item offline. While synchronizing, the following error appears, both in the sync window and the log file ol_sync.log.
"ERROR",POL-5130,"11/09/2010 11:43:52","table or view %s.%s not found:CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID","DB_ROSHNI"
However, the debug file gives this other error regarding this table.
ALL_INDEX:CREATE UNIQUE INDEX "TPCO_CONTRACTUNIT_PRODUCT_PK" ON CO_CONTRACTUNIT_PRODUCT (CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID) -5130Error at C:\ADE\omeprod_ol103021\olite\db\build\win\ocapi\..\..\..\src\ocapi\allindexes.cpp line:329 rc:-5130
Build date Mar 29 2010
okErr=(table or view %s.%s not found)
mess=(CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID)
AddLog(-5130 "ERROR",POL-5130,"11/09/2010 11:43:52","table or view %s.%s not found:CO_CONTRACTUNIT_PRODUCT,CO_CONTRACTID,OD_PRODUCTID,CO_CONTRACTUNITID","DB_ROSHNI")
But the index that is being created and is giving the error is the index created automatically with the Primary Key of the table, and so nothing has been modified in that.
The primary key of the table is created with the three columns that are part of the index that is returning the error.
As I could not solve the error, I tried to drop and re-create the item in the repository, but no luck. As a last option, i tried to remove the item from the repository to be able to sync properly again (just like before creating the item), but the error still happens.
Another weird point is that i have tried creating the item in another publication of another database (but with almost equal items), and the item could was downloaded to my local DB without any problem, which makes this problem still more bizarre.
What can it be?
Any help would be great!
Roshnihave you tried unistalling the client and reinstalling it?
schema evolution changes are not always handled correctly please check thread:
Modification of publication item into Mobile Server
i quote from rekounas instructions:
If you are just adding a field, you should only have to run the alter publication item API call.
Here is an old note on schema evolution on different scenarios. The names for the APIs that they use are now deprecated. Use the ConsolidatorManager class and call the method alterPublicationItem("PUBLICATION_ITEM_NAME", "SELECT STMT") :
A) Add column
1. Upload all client data. Clients should not add new data until they are told by the administrator to sync again!!
2. Stop Mobile Server listener
3. Change the Oracle8i/9i database schema (add column)
4. Create a Java program to call the Consolidator Admin API AlterPublicationItem()
5. Start Mobile Server
6. Execute a sync from the client
7. The new column should be seen on the client. Use MSQL to check snapshot definitions.
B) Drop column
1. Upload all client data. Clients should not add new data until they are told by the administrator to sync again!!
2. Stop Mobile Server listener
3. Delete column of the base table in the Oracle database schema
4. Create a Java program to call the Consolidator Admin API DropPublicationItem()
5. Create a Java program to call the Consolidator Admin API CreatePublicationItem() and AddPublicationItem().
6. Start Mobile Server
7. Execute a sync from the client
8. The new column should be seen on the cliet. Use MSQL to check snapshot definitions.
C) Change column datatype
Changing datatypes in a repliatated system is not an easy task. You have to follow certain procedures in order to make it to work. Use DropPublicationItem, CreatePublicationItem and AddPublicationItem methods from the Consolidator Admin API. You must stop/start Mobile Server listener to refresh the cache.
1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
2. Stop Mobile Server listener
3. Drop/create column (do not use conversion procudures) at the base table
4. Call DropPublicationItem(). Check if the ErrorQueue and InQueue no longer exist.
5. Call CreatePublicationItem() and AddPublicationItem(). Check if the ErrorQueue and InQueue reflect the new column datatype
6. Start Mobile Server. This automatically resumes application
7. Client executes sync. This should drop the old snapshot and recreate the new snapshot. Use MSQL to check
snapshot definitions.
D) Drop table
1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
2. Stop Mobile Server listener
3. Drop base table
4. Call DropPublicationItem(). Check if the ErrorQueue and InQueue no longer exist.
5. Start Mobile Server. This automatically resumes application
6. Client executes sync. This should drop the old snapshot. Use MSQL to check snapshot definitions.
E) Add table
1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
2. Stop Mobile Server listener
3. Add new base table
4. Call CreatePublicationItem() and AddPublicationItem() method
5. Start Mobile Server. This automatically resumes application
6. Client executes sync. This should add the new snapshot. Use MSQL to check snapshot definitions.
F) Changing Primary Keys
Chaning PK is a severe operation which must be executed manually. A snapshot must be deleted and recreated to propagate the changes to the clients. This causes a full refresh on this snapshot.
1. Client syncs. Clients should not add new data until they are told by the administrator to sync again!!
2. Stop Mobile Server listener
3. Drop the snapshot using DropPublicationItem() method o
4. Alter the base table
5. Call CreatePublicationItem()and AddPublicationItem() methods for the altered table
6. Start Mobile Server. This automatically resumes application
7. Client executes sync. The old snapshot will be replaced by the new snapstot using a full refresh. Use MSQL to check snapshot definitions.
G) To Change a Table Weight =>
Follow the procedure below to change the Table Weight parameter. The table weight is used by the Mobile Server/Synchronization to determin the sequence in which client records are applied to the Oracle database.
1. Run MGP to apply any changes in the InQueue to the Oracle databse
2. Change table weight using SetTemplateItemMetadata() method
3. Add/change constraint on the the base table which reflects the change in table weight
4. Synchronize
gl m8 -
Too many objects match the primary key oracle.jbo.Key
Hi OAF Gurus,
Currently we are implementing R12 Upgrade , for this we have deployed all the custom OAF Application related files on to the the respective JAVA_TOP folder.
We have a custom municipal postal application which tracks the Postal Details.
The page runs perfectly fine without any error in 11i instance, but the same is erroring out In R12.
In R12 it shows an error as Too many objects match the primary key oracle.jbo.Key[112010 2014-10-01]
here 112010 is nothing but the postal code id and 2014-10-01 is the Effective Start Date
We have a custom table as xxad_postal_codes_f (Date Track table)which contains the postal_code_id and effective_start_date (primary key is combination of postal_code_id and effective_start_date ).
The Table already contains a row for postal_code_id = 112010 and Effective_Start_date = Sysdate.
Now we want to update the entry for the same postal code with the Id being same as 112010 and Effective_Start_date as 2014-10-01 through custom PostCodeChangePG
at the time of save we are getting an error as Too many objects match the primary key oracle.jbo.Key[112010 2014-10-01]
The table doesn't contain any of the data mentioned ([112010 2014-10-01]) at the time of insertion, hence there should not be any duplication of primary key but still we are getting the error.
Please let us know how can we handle this..?
Below is the code which is getting called on Click of Save button of PostCodeChangePG
if (pageContext.getParameter("Apply") != null)
PCodeCoWorkerBase coWorker = getCoWorker(pageContext, webBean);
coWorker.processApply();
Code in PCodeCoWorkerBase
public void processApply()
String postalCodeId = UIHelper.getRequiredParameter(pageContext, "postalCodeId");
Date startDate = UIHelper.getRequiredDateParameter(pageContext , "EffectiveStartDate");
Serializable[] postalCodeData = (Serializable[]) applicationModule.invokeMethod( "insertPostalCodeMajorChange", params, paramTypes );
finalizeTransactionAndRedirect( postalCodeData );
Code in Application Module
public Serializable[] insertPostalCodeMajorChange ( String postalCodeId, Date date )
PCodeAmWorker amWorker = new PCodeAmWorker(this);
return amWorker.insertMajorChange( postalCodeId, DateHelper.convertClientToServerDate( getOADBTransaction(), date )
Code in PCodeAmWorker
public Serializable[] insertMajorChange ( String postalCodeId, Date date )
// Get the view objects we need from the application module
OAViewObject viewObject = (OAViewObject) applicationModule.getPCodesVO();
PCodesVORowImpl currentRow = (PCodesVORowImpl) viewObject.getCurrentRow();
currentRow.validate();
currentRow.setEffectiveStartDate(date);
currentRow.setComment1(currentRow.getNewComment());
// Create a new row based on the current row
PCodesVORowImpl newRow = (PCodesVORowImpl) viewObject.createAndInitRow(currentRow); //This is failing out and gives the error
// Get the new effective start date as entered by the user
Date effectiveStartDate = currentRow.getEffectiveStartDate();
// Calculate the previous period's effective end date
Date previousEffectiveEndDate = DateHelper.addDays(effectiveStartDate, -1);
// Refresh the current row (the one changed by the UI) with the data it had at the beginning of the transaction
currentRow.refresh(Row.REFRESH_UNDO_CHANGES);
// The current row will now represent data for the the previous period set the effective end date for the previous period
currentRow.setEffectiveEndDate(previousEffectiveEndDate);
// Insert the newly created row that now represents the new period
viewObject.insertRow(newRow);
applicationModule.apply();
return generateResult(newRow);
PCodesVO() is based on PostalCodeEO
below is the code from PostalCodeEOImpl
public void create(AttributeList attributeList)
// NOTE: This call will set attribute values if the entity object is created with a call to vo.createAndInitRow(..)
super.create(attributeList);
if (getPostalCodeId() == null)
setPostalCodeId(getOADBTransaction().getSequenceValue("XXAD_POSTAL_CODES_S"));
if (getEffectiveStartDate() == null)
setEffectiveStartDate(getOADBTransaction().getCurrentDBDate());
After diagnosing the issue we found that the error is on the code of AMworker file while creating a new row PCodesVORowImpl newRow = (PCodesVORowImpl) viewObject.createAndInitRow(currentRow);
we tried so many things such as clearing entity cache, VO cache, validating for duplicate primary key but still not able to resolved this.
Please advice how to insert a new row on the PCodesVORowImpl without any exception.
Thanks,
PallaviHi ,
One question here , if you are udating a existing record then why you are trying to create a new row
PCodesVORowImpl newRow = (PCodesVORowImpl) viewObject.createAndInitRow(currentRow);
Thanks
Pratap -
How do I let user enter a primary key value on a form
I'm creating my first APEX application. I have a simple table called HOSTS with 2 columns HOSTNAME and IP_ADDRESS. HOSTNAME is the primary key for the table. HOSTNAME is a perfectly acceptable primary key and I don’t wish to create an additional column to be populated by a sequence.
What are my options for creating a form on the table without using "Existing trigger", "Custom PL/SQL function" or "Existing Sequence" to populate the primary key column, i.e. HOSTNAME, so that the user can enter a value for the primary key?
Any assistance greatly appreciated.
GavinThe debate about natural keys versus surrogate keys
will no doubt continue with advocates for both sides.
However there is also a difference between
'making your life easier' for APEX development and
'making your life more difficult' by having to
analyse, implement and deploy a surrogate key only
approach to an existing database which employs both
natural keys and surrogate keys.
hould we be forced to change the database design
because a development tool does not cater for natural
primary keys?The application development product is TRYING to save you from shooting yourself in the foot. The idea is to separate the primary key from being accessed by the user or ANY carbon based unit.. The key is mainly used by the system to join and lookup data rows, not for people to change whenever they decide that the key is WRONG.
Think about this, if you use Last Name as a key in your system (a bad idea to begin with since this is NOT a unique id when you have two Smiths). When a person needs to change this because Jimmy Smith is NOT the only Smith working for Acme Toys, you have to cascade that change through all the child tables related to the main person table.
If instead you use a system generated key, no change will be required since the key has NO relation to the data other than it represents a pointer to that row of data.
Works for me, since I do not want to write all the supporting code when APEX builds it for you...
Thank you,
Tony Miller
UTMB/EHN -
Too many objects match the primary key oracle.jbo.Key[2]. Error
Hi
I have to display a Read Only table and an Editable Form below it so that the user can select a row in the table and that row should be populated in the form below.
The user should be able to update the row and save in the below form.
Then the table above also should be refreshed with the updated values.
For this I have created a VO based on EO.
Using the same data control I have created a UI Readonly table and an Editable form in the same JSF page.
When I run the page, the first row is populated in both the table and form.
When I select the second row in the table, I am getting the following error in the Editable Form
Error: Too many objects match the primary key oracle.jbo.Key[2 ].
My EO has only one Primary key and I have not included the ROWID column in EO or VO.
How can we fix this issue ?
However, if I move the editable form to another page, It is working fine.
But we need to have both the table and editable form in the same page for usability purposes.
Thanks for any help.
Sameeryou can try refreshing your VO in various ways:
1. try setting partialTrigger on table pointing to your commandbutton .. also make sure partialSubmit on your commandButton is set to true.
2. Do bindings on the page def for Execute action of your read-only VO. Call this method from actions of your commandButton.
If they dont work then you can try creating a method in your AMImpl which does calls vo.executeQuery and expose this to pageDef.. and call if from the actions of your button .. but this may not be best way
Amit -
How to defer the primary key validation to commit time
Hi
Is it possible to defer the primary key validation to commit time? I don't know why the framework checks for the unique key constraint immediately after inserting the row and before committing it. This causes "Too many objects match the primary key oracle.jbo.Key[null]" error if the user presses the create new record button multiple times before filling and saving the previous records.
Thanks,
FerezDear M.Jabr,
Many thanks for your reply. I have access to the database but I prefer to use an ADF workaround to this problem rather than a DB workaround. I am not sure but I think that there should be a way to defer or disable primary key constraint in ADF.
Anyway, I tried to make the primary key constraint DEFERRABLE in DB using PL/SQL developer but an error occurred (the name is used by another object) which I don't know why.
Thanks,
Ferez
Maybe you are looking for
-
I am having problems with adobe reader , an error message 1327 invalid drive . I have tried to remove adobe readr=er from my computer , but it wont let me . It is useless as I am unable to use it ...why can I nor remove it
-
Data does not show for forms created in 6.0 Pro, in 8.0 Pro and 10.0 Pro
Greetings... Our company have several forms created using Acrobat 6.0 Pro. We upgraded to 10.0 Pro, and noticed that the forms do open, with NO data (that was entered using 6.0 Pro). We downgraded to 8.0 Pro, with the same result. These fillable f
-
Error while creating database manually
hi guru's i am getting error while creating database manually my sql is SQL>create database lily logfile group 1 ('C:\oracle\product\10.2.0\oradata\lily\redo1.log') size 10M, group 2 ('C:\oracle\product\10.2.0\oradata\lily\redo2.log')
-
Xcode for my Mac 10.6.8
Hello, I would like to install Xcode on my Mac 10.6.8 but I can not find a compatible version. Can you give me the download links ? Regards, Marion
-
i recently bought the new ipad which is the ipad 2 now is that what it is? what is the return policy to get a full refund?