Simple unique constraint question
HI ALL,
I have created a table as below, and added unique key to both the col of the table.
CREATE TABLE TT( A NUMBER,B NUMBER);
ALTER TABLE TT ADD CONSTRAINT UNQ_CNT UNIQUE(A,B);
INSERT INTO TT VALUES (&A,&B);
Enter value for a: 1
Enter value for b: null
Enter value for a: 1
Enter value for b: null
ORA-00001: unique constraint (SCOTT.UNQ_CNT) violatedwhy I am getting the above err as Null cannot be equal to Null so the record
should be unique from other record.
Kindly help in understanding this concept.
Regards,
AAK.
AAK,
When you create UNIQUE constraint on multiple
NULLABLE columns, uniqueness is checked for NON-NULL
values. So in your case, when you try to insert
another row, ORACLE detects that column A already has
same value (1) and hence it gives error. You can find
more details in documentation.Two rows that contain nulls for one or more key columns and the same
combination of values for the other key columns violate the constraint.
Not for NON-NULL values only.
Khurram
Similar Messages
-
Hi everybody
I can't understand why my data pump import execution with parameter TABLE_EXISTS_ACTION=TRUNCATE returned ORA-00001 (unique constraint violation), while importing schema tables from a remote database where the source tables have the same unique constraints as the corresponding ones on the target database.
Now my question is "If the table would be truncated, why I get unique constraint violation when inserting records from a table where the same unique constraint is validated?
Here are the used parameter file content and the impdp logfile.
parfile
{code}
DIRECTORY=IMPEXP_LOG_COLL2
CONTENT=DATA_ONLY
NETWORK_LINK=PRODUCTION
PARALLEL=1
TABLE_EXISTS_ACTION=TRUNCATE
EXCLUDE=STATISTICS
{code}
logfile
{code}
Import: Release 10.2.0.1.0 - Production on Gioved� 22 Ottobre, 2009 15:33:44
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connesso a: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "IMPEXP"."PROVA_REFRESH_DBCOLL": impexp/********@dbcoll SCHEMAS=test_pump LOGFILE=test_pump.log parfile=refresh_dbcoll.par JOB_NAME=prova_refresh_dbcoll
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 523 MB
ORA-31693: Table data object "TEST_PUMP"."X10000000_TRIGGER" failed to load/unload and is being skipped due to error:
ORA-00001: unique constraint (TEST_PUMP.SYS_C00726627) violated
ORA-31693: Table data object "TEST_PUMP"."X10000000_BASIC" failed to load/unload and is being skipped due to error:
ORA-00001: unique constraint (TEST_PUMP.SYS_C00726625) violated
Job "IMPEXP"."PROVA_REFRESH_DBCOLL" completed with 2 error(s) at 15:34:04
{code}
Thank you
Bye AlessandroI forgot to read the last two lines of the documentation about TABLE_EXISTS_ACTION where it says:
"TRUNCATE cannot be used on clustered tables or over network links."
So it seems that it ignored the clause for the use of NETWORK_LINK and unreasonably opted for an APPEND action instead of throwing an error to highlight the conflicting parameters in the used configuration.
Bye Alessandro -
ORA-00001: unique constraint (REMEDY.SYS_C001727
Hi: I have a simple table with a primary key (ENTRYID). All other fields are just fields with no constraints. When I try to insert records, for some records I get the above error. The table does not already have this record.
INSERT INTO REMEDY.VITALEXCEPTION (ENTRYID, CUSTID, DEVICENAME, INTERFACE, EXCEPTION, DURATION, TIME)
VALUES ('jvis2rspm01.S0/0/0_FMS:65999591 NA:3836400887 TERM:cmny83bbf/20351BDU1182798445', 'fxms', 'jvis2rspm01', 'S0/0/0_FMS:65999591 NA:3836400887 TERM:cmny83bbf/20351', 'BDU', 5476, 1182792934);
INSERT INTO REMEDY.VITALEXCEPTION (ENTRYID, CUSTID, DEVICENAME, INTERFACE, EXCEPTION, DURATION, TIME)
ERROR at line 1:
ORA-00001: unique constraint (REMEDY.SYS_C001727) violated
Could someone help.
Thanks
Rayhi,
can you post the table structure?
I suspect that ENTRYID has lesser length than the actual value and in effect the value has been truncated for some reason.
The primary key value is too long, maybe creating a surrogate key would help.
J -
Uniques constraint violation error while executing statspack.snap
Hi,
I have configured a job to run the statspack snap at a interval of 20 min from 6:00 PM to 3:00 AM . Do perform this task , I have crontab 2 scripts : one to execute the job at 6 PM and another to break the job at 3 AM. My Oracle version is 9.2.0.7 and OS env is AIX 5.3
My execute scripts look like:
sqlplus perfstat/perfstat <<EOF
exec dbms_job.broken(341,FALSE);
exec dbms_job.run(341);
The problem is , that the job work fine for weekdays but on weekend get aborted with the error :
ORA-12012: error on auto execute of job 341
ORA-00001: unique constraint (PERFSTAT.STATS$SQL_SUMMARY_PK) violated
ORA-06512: at "PERFSTAT.STATSPACK", line 1361
ORA-06512: at "PERFSTAT.STATSPACK", line 2471
ORA-06512: at "PERFSTAT.STATSPACK", line 91
ORA-06512: at line 1
After looking on to metalink , I came to know that this is one listed bug 2784796 which was fixed in 10g.
My question is , why there is no issue on weekdays using the same script. There is no activity on the db on weekend and online backup start quite late at night.
Thanks
AnkyThe reasons for hitting this bug are explained in Metalink, "...cursors with same sql text (at least 31 first characters), same hash_value but a different parent cursor...", you can also find the workaround in Note:393300.1.
Enrique -
Insert called before delete in a collection with unique constraint
Hi all,
I have a simple @OneToMany private mapping:
private Collection<Item> items;
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
public Collection<Item> getItems() {
return items;
public void setItems(Collection<Item> items) {
this.items = items;
public void customize(ClassDescriptor classDescriptor) throws Exception {
OneToManyMapping mapping = (OneToManyMapping)
classDescriptor.getMappingForAttributeName("items");
mapping.privateOwnedRelationship();
I have a unique constraint on my Items table that a certain value cannot be duplicated.
My problem appears when I remove a previously saved item from the collection and add a new item containing the same data, at the same time.
After I save the parent and do a flush, I receive SQLIntegrityConstraintViolationException because TopLink performs first an insert query instead of deleting the existing item.
I tested the application and everything went fine with: remove item / save parent / insert item / save parent
I checked on the Internet and the documentation but didn't find anything similar to my problem. I tried debugging TopLink's internal calls but I'm missing some general ideas about all the inner workings and don't know what to look for. I use TopLink version: Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))
Does anyone have a hint of what to look for?
Edited by: wise_guybg on Sep 25, 2009 4:01 PM
Edited by: wise_guybg on Oct 5, 2009 11:22 AMThank you for the suggestions James
As I mentioned briefly I have done some debugging but couldn't understand how collections are updated. What I did find out is that setShouldPerformDeletesFirst() doesn't come into play in this case because this is not a consecutive change on entities.
What I have in my case is a collection inside an entity that the user has tampered with and now TopLink has to do a merge. I cannot call flush() in the middle since the user has not approved that the changes made to the entity should be saved.
I see that for TopLink it's not easy to figure out the order in which changes were made to a collection. Here is pseudo-code of when the constraint is touched:
entity.items.remove(a)
entity.items.add(b)
merge(entity)
And here is code that executes without a problem:
entity.items.remove(a)
merge(entity)
entity.items.add(b)
merge(entity)
So once again, I think that collection changes are managed differently but I don't find a way to tell TopLink how to handle them. Any ideas? -
Adding a UNIQUE Constraint to an existing table
Hi,
I got this issue because of the existing data. My issue is in my table I want to add a unique constraint to two columns but i cannot add this becuase of the existing repeating data. And I cannot do a data repair to fix the repeating data since the customer is reling on this data so we can not get the decision to repair the data.
As a solution I try this method, by adding a function to check the repeating data before inserting the data to the table. It's working fine to a user but when it come to multiple users it's not working because users can log to the database and can do their transactions simultaneously.
My question is; is there a way in oracle to add a constraint to the data that can add in future not to the old existing data?
Thanks,
Darex.user9359353 wrote:
Hi,
As a solution I try this method, by adding a function to check the repeating data before inserting the data to the table. It's working fine to a user but when it come to multiple users it's not working because users can log to the database and can do their transactions simultaneously.
show us what is "not working". if you are calling this function from a trigger the correct way, the first person to commit will have their data inserted and the next person will not be able to insert.
edit: you may want to have a read through this thread: where I was encountering a problem with multi-row validation using triggers:
Row level validation dependant on other rows?
note this post:
Rob van Wijk wrote:
Hi WhiteHat,
Here are two blogposts of mine about this subject that you might find useful.
One with some guidelines about implementing entity rules: http://rwijk.blogspot.com/2008/08/implementing-entity->rules.html
And one with an example how to implement (among others) an overlap check in the context of another option for your >question, the product RuleGen: http://rwijk.blogspot.com/2008/05/rulegen-test.html
Hope this helps.
Regards,
Rob.Edited by: WhiteHat on Jun 8, 2011 3:51 PM -
Unique constraint violation error
Hello All,
I have a procedure called - FHM_DASHBOARD_PROC which inserts the data into a table called FHM_DASHBOARD_F fetching records from several tables. However, for a particular type of record, that data is not being inserted because of the Unique constraint violation
the procedure is:
create or replace
PROCEDURE FHM_DASHBOARD_PROC AS
DB_METRICS_CNT1Z number;
--V_PODNAME varchar2(10);
V_KI_CODE_DB_STATSZ varchar2(50);
V_ERRORSTRING varchar2(100);
--CURSOR PODNAME_CUR IS SELECT PODNAME,SHORTNAME FROM CRMODDEV.POD_DATA WHERE PODSTATUS_ID=1 AND PODTYPE_ID=1 ORDER BY PODNAME;
-- DB STATS
BEGIN
-- OPEN PODNAME_CUR;
-- LOOP
-- FETCH PODNAME_CUR INTO V_PODNAME,V_POD_SHORTNAME ;
-- EXIT WHEN PODNAME_CUR%NOTFOUND;
BEGIN
SELECT COUNT(*) INTO DB_METRICS_CNT1Z FROM FHM_DB_METRICS_F A, FHM_DB_D B where A.DBNAME=B.DBNAME and PODNAME=V_PODNAME AND DB_DATE=TRUNC(SYSDATE-1);
DBMS_OUTPUT.PUT_LINE('DB_METRICS_CNT1Z :'|| DB_METRICS_CNT1Z);
IF DB_METRICS_CNT1Z >0 THEN
DBMS_OUTPUT.PUT_LINE('DB STATS');
INSERT INTO FHM_DASHBOARD_F(PODNAME,DASH_DATE,KI_CODE,KI_VALUE,KI_STATUS)
(SELECT PODNAME, DASH_DATE AS CU_DATE, KI.KI_CODE, NVL(PF.KI_VALUE,0),
CASE
WHEN PF.KI_VALUE = ki.warning_threshold then 2
when PF.KI_VALUE=0 then 0
ELSE 1
END AS ALERT_STATUS
FROM
(SELECT PODNAME,DB_DATE AS DASH_DATE,decode(a.stats_last_status,'SUCCEEDED',1,'FAILED',2,'STOPPED',2,NULL,0) KI_VALUE from
FHM_DB_METRICS_F a,fhm_db_d b where a.dbname=b.dbname and podname='XYZ' and db_date=TRUNC(SYSDATE-1) and dbtype='OLTP')PF,
FHM_KEY_INDICATOR_D KI where PF.PODNAME=KI.POD_NAME AND KI.TIER_CODE=3 AND KI.KI_NAME='DB_STATS'
AND (PF.PODNAME,TRUNC(PF.DASH_DATE),KI.KI_CODE) NOT IN (SELECT PODNAME,DASH_DATE,KI_CODE FROM FHM_DASHBOARD_F));
COMMIT;
ELSE
SELECT KI_CODE INTO V_KI_CODE_DB_STATSZ FROM FHM_KEY_INDICATOR_D WHERE POD_NAME=V_PODNAME AND KI_NAME='DB_STATS';
DBMS_OUTPUT.PUT_LINE('V_KI_CODE_DB_STATSZ :'||V_KI_CODE_DB_STATSZ);
INSERT INTO FHM_DASHBOARD_F(PODNAME,DASH_DATE,KI_CODE,KI_VALUE,KI_STATUS) VALUES(V_PODNAME,TRUNC(SYSDATE-1),V_KI_CODE_DB_STATSZ,0,0);
COMMIT;
END IF;
EXCEPTION
WHEN OTHERS THEN
V_ERRORSTRING :='INSERT INTO FHM_DASHBOARD_F_ERROR_LOG(POD_NAME,KI_NAME,ERRORNO,ERRORMESSAGE,DATETIME) VALUES
('''||V_PODNAME||''',''DB_STATS'','''||SQLCODE||''','''||SQLERRM||''',SYSDATE)';
EXECUTE IMMEDIATE V_ERRORSTRING;
COMMIT;
END;
--END LOOP;
--CLOSE PODNAME_CUR;
END;
END FHM_DASHBOARD_PROC;and the table where the data is inserting is
CREATE TABLE "CRMODDEV"."FHM_DASHBOARD_F"
"PODNAME" VARCHAR2(25 BYTE) NOT NULL ENABLE,
"DASH_DATE" DATE,
"KI_CODE" NUMBER NOT NULL ENABLE,
"KI_VALUE" NUMBER,
"KI_STATUS" NUMBER,
CONSTRAINT "FHM_DASHBOARD_F_DATE_PK" PRIMARY KEY ("DASH_DATE", "PODNAME", "KI_CODE") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 NOLOGGING COMPUTE STATISTICS STORAGE(INITIAL 4194304 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "CRMODDEV_IDX" ENABLE,
CONSTRAINT "FHM_DASHBOARD_F_KI_CODE_FK" FOREIGN KEY ("KI_CODE") REFERENCES "CRMODDEV"."FHM_KEY_INDICATOR_D" ("KI_CODE") ENABLE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS NOLOGGING STORAGE
INITIAL 3145728 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT
TABLESPACE "CRMODDEV_TBL" ENABLE ROW MOVEMENT ;the Primary key constraint is FHM_DASHBOARD_F_DATE_PK and is on 3 columns of the table DASH_DATE, PODNAME, KI_CODE
And this is the query used in the Procedure for inserting the data into the table
(SELECT PODNAME, DASH_DATE AS CU_DATE, KI.KI_CODE, NVL(PF.KI_VALUE,0),
CASE
WHEN PF.KI_VALUE = ki.warning_threshold then 2
when PF.KI_VALUE=0 then 0
ELSE 1
END AS ALERT_STATUS
From
(Select Podname,Db_Date As Dash_Date,Decode(A.Stats_Last_Status,'SUCCEEDED',1,'FAILED',2,'STOPPED',2,Null,0) Ki_Value From -- Added Distinct
FHM_DB_METRICS_F a,fhm_db_d b where a.dbname=b.dbname and podname in ('XYZ') and db_date = TRUNC(SYSDATE-2) and dbtype='OLTP')PF,
Fhm_Key_Indicator_D Ki Where Pf.Podname=Ki.Pod_Name And Ki.Tier_Code=3 And Ki.Ki_Name='DB_STATS'
And (Pf.Podname,Trunc(Pf.Dash_Date),Ki.Ki_Code) Not In (Select Podname,Dash_Date,Ki_Code From Fhm_Dashboard_F));It gives *2 record* as result
XYZ 20-JAN-12 2521 1 1
XYZ 20-JAN-12 2521 1 1
So it gives Unique constraint violation error while inserting. Then, I changed in the above inserting code by adding a distinct clause. After that the query gives only ONE record as result. However, that record also is not being inserted into the table and giving the same error.
Now the question is How shall I insert this record into the table successfully ?
Though the message is too long, However, I have given you the full structure of the object/procedure and error.
Thank You in Advance.when you have 5 columns in the result set adding DISTINCT is n ot the solution as you may get the same error again.
Check the target table whether the data exists before inserting ..if not check the table structure for unique constraint created on other columns.
select *from <table_name>
where
DASH_DATE=date '2012-01-20'
and PODNAME='XYZ'
and KI_CODE=2521; -
Unique constraint ERROR How to update the task order customly?
I am using DAC to load data from Siebel database into Oracle Business Analytic Data Warehouse for BI Apps. Now we encounter a question. I need some help.
When I run current execute plan, the Custom_shyy_SIL_ActivityFact is failured.Beause the *'unique constraint (SHYY_OLAP_DEV.W_ACTIVITY_F_U1) violated'* ORA_00001 ERROR. I analyse this question.At last, I think this question is caused with some below reason.
My custom execute plan include some Update Dimension from Dimension tasks. They are SIL_EmployeeDimension_SCDUpdate and SIL_ProductDimension_SCDUpdate and so no. that tasks that marked Update Dimension from Dimension run before the Custom_shyy_SIL_ActivityFact. And, in the w_product_d one integration_id corresponding with two records, but the curent_flag ='Y' recored is only. Now ,I Think the SDCU Task is run before the Load fact tack. I discoved it does't work. please help me !Hey
When Doing a full Load through DAC it drops all the unique indexes and then inserts the data and recreates the indexes again.The Index Creation fails if there are duplicate rows (Rows with same integration_id).
So start Checking the Data right from the Source Level.
First check the Source (do this using the integration_id thats repeating,Go through the informatica Mappings(ETL Mappings).
If its Fine there Come to the Staging Level and Check for Duplicate Columns.
Then Check in the final Table for Duplicate records.
My Guess is that you are having duplicate rows at the Source level.
If your are using informatica try using distinct for the SQL in the Source Qualifier(think that should block any duplicate records).
Update here If you are able to solve this.
Thanks
Hemanth -
Unique constraint deployable=false
I am new to OWB. We are using client version 10.1.0.2.0.
We have a mapping where the target table (a cube) is set to update/insert, match by a unique constraint which comprises two values. A non-unique index on the cube comprises the same two values. The constraint is set to deployable=false, so of course the constraint is not on the table in the database when the cube is deployed. The corresponding non-unique index is set to deployable=true, so it is on the deployed cube in the database.
My question: Why set a constraint (especially a unique constraint) to not deploy? Does OWB still check the constraint to make sure it's not a duplicate before inserting a new record, and if so, what is it checking if the constraint does not exist on the table and the associated index is not unique?
I searched the forum to see if this question had been answered, but was not able to find what I was looking for. I also tried the OWB user docs and help, but didn't find the answer. They tell me what deployable means, but not why to set it a certain way. If it is in docs anywhere, please direct me to the answer.
TIAHi
Where do you see in Oracle Warehouse Builder: "constraint is set to deployable=false"?
Ott Karesz
http://www.trendo-kft.hu -
Hi,
I am a newbie to oracle..
I have a composite primary key consisting of sequence,reg_no,srvc_code and srvc_type..
when i tried inserting a record through the application it is showing that Unique constraint violated..But i did not find the record in the table for the same values
and if I insert the same values with an sql insert statement,the record is inserted successfully..Please suggest me the possibilities of getting such an error.952759 wrote:
Hi,
I am a newbie to oracle..
I have a composite primary key consisting of sequence,reg_no,srvc_code and srvc_type..
when i tried inserting a record through the application it is showing that Unique constraint violated..But i did not find the record in the table for the same values
and if I insert the same values with an sql insert statement,the record is inserted successfully..Please suggest me the possibilities of getting such an error.Either Oracle is mistaken or you are mistaken.
I'll give you 1000 to 1 odds that Oracle is correct & you are mistaken.
How can we reproduce what you report?
How do I ask a question on the forums?
SQL and PL/SQL FAQ -
Unique Constraint causes AppSetRollbackOnlyException
I have declared a unique constraint using the following annotation.
@Column(name="classname",columnDefinition="varchar(1024)",nullable=false,unique=true)
When trying to insert duplicate entities with the same name, essentially violating the constrain the following exception appears. It is not directly obvious what is causing this exception and it only is thrown during the commiting of the transaction, rather during the persist() which makes it difficult to intercept and handle.
<24-Jan-2008 11:01:33 o'clock GMT> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB com.thunderhead.simple.SimpleBean.process(int)],Xid=BEA1-0660A26EF337BD76B51F(9378830),Status=Rolled back. [Reason=weblogic.transaction.internal.AppSetRollbackOnlyException],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=60,SCInfo[wl_server+examplesServer]=(state=rolledback),properties=({weblogic.transaction.name=[EJB com.thunderhead.simple.SimpleBean.process(int)]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+192.168.2.165:7001+wl_server+t3+, XAResources={examples-demoXA, WLStore_wl_server_WseeFileStore, examples-demoXA-2, WLStore_wl_server_exampleJDBCStore, examples-multiDataSource-demoXAPool, WLStore_wl_server__WLS_examplesServer},NonXAResources={})],CoordinatorURL=examplesServer+192.168.2.165:7001+wl_server+t3+): weblogic.transaction.RollbackException: Unknown reason
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1818)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:333)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:227)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:611)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:57)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvokeTxRetry(BaseRemoteObject.java:431)
at com.thunderhead.simple.SimpleBean_t2toec_SimpleRemoteImpl.process(SimpleBean_t2toec_SimpleRemoteImpl.java:75)
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:64)
at $Proxy300.process(Unknown Source)
at com.thunderhead.weblogic.StartupService.postStart(Unknown Source)
at weblogic.application.internal.flow.BaseLifecycleFlow$PostStartAction.run(BaseLifecycleFlow.java:292)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.application.internal.flow.BaseLifecycleFlow$LifecycleListenerAction.invoke(BaseLifecycleFlow.java:194)
at weblogic.application.internal.flow.BaseLifecycleFlow.postStart(BaseLifecycleFlow.java:66)
at weblogic.application.internal.flow.TailLifecycleFlow.activate(TailLifecycleFlow.java:33)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.EarDeployment.activate(EarDeployment.java:16)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:140)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:106)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:820)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1227)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:436)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:517)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
.>
<24-Jan-2008 11:01:34 o'clock GMT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1201172492513' for task '35'. Error is: 'javax.ejb.EJBException: nested exception is: weblogic.transaction.internal.AppSetRollbackOnlyException'
javax.ejb.EJBException: nested exception is: weblogic.transaction.internal.AppSetRollbackOnlyException
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:79)
at $Proxy300.process(Unknown Source)
at com.thunderhead.weblogic.StartupService.postStart(Unknown Source)
at weblogic.application.internal.flow.BaseLifecycleFlow$PostStartAction.run(BaseLifecycleFlow.java:292)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
Truncated. see log file for complete stacktrace
javax.ejb.EJBException: nested exception is: weblogic.transaction.internal.AppSetRollbackOnlyException
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:79)
at $Proxy300.process(Unknown Source)
at com.thunderhead.weblogic.StartupService.postStart(Unknown Source)
at weblogic.application.internal.flow.BaseLifecycleFlow$PostStartAction.run(BaseLifecycleFlow.java:292)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
Truncated. see log file for complete stacktrace
This is on 10.3 Technology PreviewHi Tyson,
Are you sure there are no other rows that have a conflicting value for the unique constraint? What you have described should work. Since the rows have been deleted, they are no longer considered when evaluating the constraints when executing RefreshTable. You should be able to both merge and refresh the workspace after deleting the rows. Also, the row(s) with the 'D' wm_optype would not have a retiretime value, unless the row was reinserted. Only the 'I' or 'U' row(s) would have a retiretime value in this case.
If there are not any other rows, then I would need a more complete description. Are there any continuously refreshed workspaces that have T-520575 as a parent workspace? Those workspaces would also have to be checked.
Regards,
Ben -
Reattempt of insert after a ORA-0001 unique constraint violation
Hi,
I'm inserting into a table. The primary key on this table is made up of the user id and a one-up transaction number. Unfortunately, I cannot change the design of this table.
Because I have to query the table to get the next transaction number before I insert into the table, I sometimes get a ORA-0001 (unique constraint violation) error because some other session grabbed the next transaction number and committed before I did.
To deal with this I retry the insert, that is, read the table again for the next tran number and insert. I allow for this up to 3 times. If after the third attempt I fail again, I rollback.
I'm seeing 3 records in the table.
So here are my questions: Do I need to rollback when I get the ORA-0001 error? I thought I wouldn't have to. If I do, why? The insert failed, how could the commit statement commit 3 records?
Thanks!No, the userid and transaction numbers are not the same (combined) for each of the 3 rows.
Here is the logic to retry again when I get a ORA-0001:
PROCEDURE insert_record(
table1_rec_in IN table1%ROWTYPE,
tran_number OUT table1.trans_number%TYPE,
attempt_number IN PLS_INTEGER)
IS
next_tran_number table1.trans_number%TYPE;
BEGIN
SELECT NVL(MAX(trans_number), 0) + 1
INTO next_tran_number
FROM table1
WHERE userid = table1_rec_in.table1_userid;
INSERT INTO table1
(userid,
trans_number,
amount,
transdate)
VALUES
(table1_rec_in.userid,
next_tran_number,
table1_rec_in.amount,
SYSDATE);
tran_number := next_tran_number;
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
IF attempt_number < 3
THEN
DECLARE
next_attempt_number PLS_INTEGER;
BEGIN
next_attempt_number := attempt_number + 1;
insert_record(
table1_rec_in,
tran_number,
next_attempt_number);
END;
ELSE
RAISE unable_to_insert_rec;
END IF;
WHEN OTHERS THEN
RAISE unable_to_insert_rec;
END;
I'm using recursion to try the insert again. Is this the source of my problems? I don't see it and can't reproduce it. -
TopLink inserts when it should update, unique constraint exception
The title says most of it. I am creating a series of objects and then updating them in rapid succession. It would be great to handle all the values during the insert, but it's not possible for this process. The majority of the time, the cached object is updated correctly and no problem occurs, but every once in a while TopLink tries to re-insert the previously inserted object, instead of updating it. Obviously this throws a unique constraint exception for the PK, and boots me out of the process.
I can refreshObject and then it works fine. I'm looking for the underlying cause though. I want to be able to use the cache!
Thanks!!
Aaron
Oracle JDBC driver Version: 10.2.0.3.0
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
TopLink Release-Designation: 10g Release 3Hello,
How are you obtaining these objects to update them? The likely cause is that you are running out of memory and the objects in the shared identity map are getting garbage collected due to weak references. This means that when they get registered, TopLink can't find them in the cache so assumes they are new (the default existence check is check cache).
If this is the case, there are a few options.
1) Increase the size of the cache for the class in question to something more appropriate for your application, or use a fullIdentyMap so nothing ever gets pushed out. Of course, a FullIdentityMap should not be used lightly as it prevents its objects from beign gc'd and has consequences to related objects as described in:
Caching Causing Memory Leak Effect
Both these options will require more memory resources though, so if garbage collection is running and clearing out the references because you are already low on memory, this might make GC need to run more frequently
2) Increase the JVM memory. This assumes completely that GC is clearing out the unused weak references from your cache because it is low on memory - GC can still occur so it doesn't guarantee the problem will be any better
3) Read in the object through the UnitofWork before making changes (instead of using RegisterObject on existing objects), use the registerExistingObject for known existing objects or use the uow mergeClone method. Merge should cause the object to be read from the database if it is not in the cache, but it depends on the existence options used
Best Regards,
Chris -
Mapping failed due to Unique Constraint
Hi,
We are using Oracle Financial Analytics and noticed that one of the mapping SIL_PositionDimenstionHierarchy failed due to Unique Constraint.
Mapping was inserting data into W_POSITION_DH table.
Is there a way to find the source table from where it is inserting the record?
I don't have much Informatica experience.
Thanks,
PoojakHi,
Our servers are hosted to Oracle On Demand. I have opened a ticket with Oracle. They have asked us to aply a patch to increase the version of the Mapping.
Please see update from Analyst.
"Development team is requesting to apply patch number 9782718, which solves this issue as well.
You need to go to Patches and Updates tab on Support Portal, click on Oracle, Siebel and Hyperion products link and do a simple search with patch number 9782718. The patch files contain detailed instructions.
Please test on your Test environment first before applying to Production. Let us know if you have any issues.
Thanks,
Poojak -
Error while adding Image: ORA-00001: unique constraint
Dear all,
I have an error while adding images to MDM I can´t explain. I want to add 7231 images. About 6983 run fine. The rest throws this error.
Error: Service 'SRM_MDM_CATALOG', Schema 'SRMMDMCATALOG2_m000', ERROR CODE=1 ||| ORA-00001: unique constraint (SRMMDMCATALOG2_M000.IDATA_6_DATAID) violated
Last CMD: INSERT INTO A2i_Data_6 (PermanentId, DataId, DataGroupId, Description_L3, CodeName, Name_L3) VALUES (:1, :2, :3, :4, :5, :6)
Name=PermanentId; Type=9; Value=1641157; ArraySize=0; NullInd=0;
Name=DataId; Type=5; Value=426458; ArraySize=0; NullInd=0;
Name=DataGroupId; Type=4; Value=9; ArraySize=0; NullInd=0;
Name=Description_L3; Type=2; Value=; ArraySize=0; NullInd=0;
Name=CodeName; Type=2; Value=207603_Img8078_gif; ArraySize=0; NullInd=0;
Name=Name_L3; Type=2; Value=207603_Img8078.gif; ArraySize=0; NullInd=0;
Error: Service 'SRM_MDM_CATALOG', Schema 'SRMMDMCATALOG2_m000', ERROR CODE=1 ||| ORA-00001: unique constraint (SRMMDMCATALOG2_M000.IDATA_6_DATAID) violated
Last CMD: INSERT INTO A2i_Data_6 (PermanentId, DataId, DataGroupId, Description_L3, CodeName, Name_L3) VALUES (:1, :2, :3, :4, :5, :6)
Name=PermanentId; Type=9; Value=1641157; ArraySize=0; NullInd=0;
Name=DataId; Type=5; Value=426458; ArraySize=0; NullInd=0;
Name=DataGroupId; Type=4; Value=9; ArraySize=0; NullInd=0;
Name=Description_L3; Type=2; Value=; ArraySize=0; NullInd=0;
Name=CodeName; Type=2; Value=207603_Img8085_gif; ArraySize=0; NullInd=0;
Name=Name_L3; Type=2; Value=207603_Img8085.gif; ArraySize=0; NullInd=0;
I checked all data. There is no such dataset in the database. Can anybody give me a hint how to avoid this error.
One thing I wonder: The PermanentId is allways the same but I can´t do anything here.
BR
Roman
Edited by: Roman Becker on Jan 13, 2009 12:59 AMHi Ritam,
For such issues, can you please create a new thread or directly email the author rather than dragging back up a very old thread, it is unlikely that the resolution would be the same as the database/application/etc releases would most probably be very different.
For now I will close this thread as unanswered.
SAP SRM Moderators.
Maybe you are looking for
-
How to schedule a batch job for VT01N?
Hello SAP gurus, Below is my concern: Requirement is I need to schedule a daily shipment job on SAP utilizing Tcode VT01N and we have the Variant name. I have to process daily shipments (for one shipment only) to invoice required. And the job should
-
Can't add music to iPhone 5s and songs not deleting off phone
Tried restarting phone several times and this has not resolved the issue. I have deleted a bunch of music off of my phone... when I plug into iTunes, the songs do not show in iTunes but remain on my phone... also when I try to add new music - it won'
-
How to use a patched version of pdftex?
Hello, I would like to use a patched version of pdftex to be able to compile PDF/A compliant documents. Patch is here, and the compilation works without problems. However, I do not manage to use that compiled version of pdftex. Using the instructions
-
Three basic questions regarding standalone versions of DVDSP: Q1: Which version of DVDSP works better on a Dual 2 Ghz Tower G5 power mac (Model A1047) if my objective is to add HD capabilities? Q2: I'm currently running Tiger, FCP 4.5, & DVDSP 3 only
-
Hi Does anyone know how to use dialogs with servlets? I'd like to show a confirm dialog on the client machine. My first idea was to use JOptionPane.showConfirmDialog as such in the servlet, but then of course de dialog pops-up on the server side, and