How to set Hybris db transaction timeout using oracle database?
I have tried the following code but no effect, thanks in advance.
TransactionTemplate template = new TransactionTemplate(manager);
template.setTimeout(1);
You can set in local.properties db.connectionparam.oracle.jdbc.ReadTimeout or db.connectionparam.oracle.net.READ_TIMEOUT (both in millisecond).
Check this post for the difference : https://stackoverflow.com/a/18513472/1140748
To explain a bit, in the platform, in AbstractTenant you have a method extractCustomDBParams that checks for key starting with db.connectionparam .
Related
I got an old nodeJs MongoDb project.
In the code the save function has as option:
save({safe: {j: true}}, (e, o) => {})
But "safe" is depreacted. It is indicated to use the option "w" with in the warning the link for more details (https://mongoosejs.com/docs/api.html#model_Model-save).
Unfortunately I do not have more details on the use of the w option. Could you guide me on this subject?
Knowing that I spent the afternoon looking for this information.
Many thanks in advance to you!
I guess you could simply do save({"w": 1}); use 1/0 depending upon your requirement.
1: Requests acknowledgment that the write operation has propagated to the standalone mongod or the primary in a replica set
0: Requests no acknowledgment of the write operation. However, w: 0 may return information about socket exceptions and networking errors to the application.
I've a question on db: { safe: true } - which is being passed as an option to mongoose.connect in my nodeJS and MongoDB project.
I have the impression that this option is obsolete. Is that the case ?
If yes, what was it replaced by?
If not, where can I find the details of this option?
Knowing that I spent the afternoon looking for this information.
Many thanks in advance to you!
This behavior, "SafeMode" appears to be obsolete. This is the equivalent of WriteConcern.Acknowledged, which is the default now.
You can manage this behavior on a transaction basis now, read more about WriteConcern here: https://docs.mongodb.com/manual/reference/write-concern/
I need to clear/reset the external ID on a record in NetSuite, but nothing I do is working.
Some of the InventoryItem records are incorrectly mapped to records in another system. I have an application that can sync up the two systems, but I need to clear NetSuite's external IDs first.
Responses don't really need to be SOAP-specific. If you know how to do it with some specific NetSuite/SuiteTalk client, that might point me in the right direction.
What I've Tried
First up, I tried using the nullFieldList... but maybe it doesn't work because externalId is an attribute, not an element?
<messages:update>
<messages:record internalId="7777" xsi:type="accounting:InventoryItem">
<core:nullFieldList xsi:type="core:NullField">
<core:name>externalId</core:name>
</core:nullFieldList>
</messages:record>
</messages:update>
The external ID is just a string, so I tried just setting it to blank. Didn't work either.
<messages:update>
<messages:record internalId="7777" xsi:type="accounting:InventoryItem">
<accounting:externalId></accounting:externalId>
</messages:record>
</messages:update>
I even tried setting the external ID to 0, but I get back a "not unique identifier" error
<messages:update>
<messages:record internalId="7777" xsi:type="accounting:InventoryItem">
<accounting:externalId>0</accounting:externalId>
</messages:record>
</messages:update>
Other Info
I'm using NetSuite's SOAP API v.2013_1
When I say "it doesn't work", I mean: after I do the update, I get a success response similar to the following:
<readResponse>
<platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2013_1.platform.webservices.netsuite.com"/>
<record internalId="7777" externalId="42" xsi:type="listAcct:InventoryItem" xmlns:listAcct="urn:accounting_2013_1.lists.webservices.netsuite.com">
<!-- snip -->
</record>
</readResponse>
If you are using scripts in netsuite you can run a scheduled script to clear records in NS by loading each record and setting the externalid to '' using the following simple code:
var rec= nlapiLoadRecord(type,id);
rec.setFieldValue('externalid','');
nlapiSubmitRecord(rec);
This seemed to work for me in my enviornment which was on 2015.2.
Unfortunately my understanding is that once you set an externalid you cannot clear it, you can set it to another value, but not back to null. I have experienced this both using SuiteScript as well as a Boomi process that uses the 2014.1 endpoint. This may have changed in the recent releases, as I have not tried it recently with SuiteScript nor with a newer endpoint.
You can eliminate the externalId on a record once it's been set. Here's an example using the NetSuite gem:
ns_customer = NetSuite::Records::Customer.get external_id: 'ext_id'
ns_customer.external_id = ''
ns_customer.update
Here's the corresponding XML for update:
<env:Body>
<platformMsgs:update>
<platformMsgs:record xsi:type="listRel:Customer" platformMsgs:internalId="199113" platformMsgs:externalId=""/>
</platformMsgs:update>
</env:Body>
I have had to attempt this before as well. I know the pains you describe. I ended up putting a "-" in front of my external ID to unlink it between my systems. You can do this in SOAP or even as a simple one time csv upload. As it was one time, I did csv.
I am using Mondrian as my server olap engine.
I have a scenario where some of my dimensions data is changing. When this happens I would like to clear mondrian cache.
I cannot understand how I can get a handle to Mondrian's cache control.
I have a reference to OlapConnection object, but I could not find any method that would give a handle to the CacheControl
Any suggestions?
Yosi
The answer given by bhuang3 is right. To access the cache control from an olap4j connection:
OlapConnection.unwrap(mondrian.rolap.RolapConnection.class).getCacheControl(null)
Well, you can use following APIs to flush the cube's cache
mondrian.olap.CacheControl cacheControl = connection.getCacheControl(null);
mondrian.olap.Schema schema = connection.getSchema();
mondrian.olap.Cube cube = schema.lookupCube(cubeName, false);
mondrian.olap.CacheControl.CellRegion cellRegion = cacheControl.createMeasuresRegion(cube);
cacheControl.flush(cellRegion);
Or you can flush the schema cache
cacheControl.flushSchemaCache();
Alternatively, please read this doc to get more details.
I am using the following code to update an entity.
Service.Update(_policy);
where policy is a class generated using CrmSvcUtil.exe
public partial class new_policy : Microsoft.Xrm.Sdk.Entity, System.ComponentModel.INotifyPropertyChanging, System.ComponentModel.INotifyPropertyChanged
I retrieve the policies using LINQ, then update one attribute (an EntityReference) and then attempt the update
When this code runs I get the following error message:
EntityState must be set to null, Created (for Create message) or
Changed (for Update message)
There are other entities generated in the same way that I can update.
I tried
_policy.EntityState = EntityState.Changed
but then I get a message saying
The entity is read-only and the 'EntityState' property cannot be
modified. Use the context to update the entity instead.
Does anyone know what is causing this?
You have to tell your crmContext (use appropriate name) what to do with the changes.
You should add crmContext.UpdateObject(contact); before crmContext.SaveChanges();
See also How to update a CRM 2011 Entity using LINQ in a Plugin?
To avoid the problem you can simply use update-helper-objects instead of using the retrieved record:
var policyUpdater = new Policy { Id = _policy.Id, FieldToUpdate = "newValue" };
service.Update(policyUpdater);
Note: Properties of the update-helper-object that aren't set are simply ignored. The update won't set the corresponding record fields to null
I had the same problem. I switched from using
context.Update(object)
to
context.UpdateObject(object)
and it worked.
This worked for me:
recordToUpdate.EntityState = EntityState.Changed;
(recordToUpdate is an Entity to be updated)
Turns out it was an issue with my linq query that was retrieving the entity in the first place. When I replaced this with a query expression it worked okay.
Time to brush up on my linq!