Entity Not Updated in Database - database

I was trying to update entries in the package using EntityManager but its entity is not getting updated for some reason.
I was using entityManager.merge(entity) to update.
Any suggestions on how to fix or debug?

Would have been nice to put the code here, did You try using #Transactional on the method?
also check this link which is similar to your question.

Related

getattproperties: 70th attribute tuple from City_fact (relid=27835515) relation of DWA(dbid=296643) database not found

I am using Netezza system where nps version is 7.2.0.6. I am trying to run a query on a view which is created on base table City_fact.
But getting above error.
Can someone please let me know in which scenario we get above error. I tried to find but was not successful.
I faced the same issue in Netezza after migrating from TWINFIN to MAKO version. Drop and recreating the view worked in my case. Not sure this will help . but a suggestion if any faced similar issue.
Regards,
Bharani Raj
This error was encounter when any base object id got changed (by alter table) which is used in any view, and that is not reflected in the view. in such case you need to refresh the view (Create or replace view)

Detected resolved migration not applied to database on flyway

We are using flyway to manage database schema version and we are facing a problem. Since we work as a team and use git as our source code management, there would be some cases that different people update database schema on their own local repo. If that happens, we will get
Detected resolved migration not applied to database: 2016.03.17.16.46"
The time "2016.03.17.16.46" was added by another person and I have already applied some timestamp later than that time. If that happens, we have to clean all database tables and create them again. We have tried to set false on validateOnMigrate and did flywayClean, but nothing help. Is there another way to change that?
The migration option outOfOrder is your friend here. Set it to true to allow inserting those migrations after the fact.
On the command line, run:
flyway -outOfOrder=true migrate
Or if you use the Maven plugin:
mvn -Dflyway.outOfOrder=true flyway:migrate
I faced similar problem when switching from one git branch to another and tried to run
flyway:migrate.
For example when I was on branch 'release_4.6.0' I didn't have migrations on my local machine from branch 'release_4.7.0' so
I received next error
FlywayException: Validate failed: Detected applied migration not resolved locally.
The solution that worked for me is to set ignoreMissingMigrations flyway option to true.
In maven it looks like
flyway:migrate -Dflyway.ignoreMissingMigrations=true
Maybe it's not an answer for this question, but it can be helpful for those who faced the same problem as me.
Here you can find more details:
https://flywaydb.org/documentation/configuration/parameters/ignoreMissingMigrations
You can also put it in your application.properties file if you want to apply the migrations when starting up the app:
spring.flyway.out-of-order=true
just add spring.flyway.ignore-missing-migrations=true
to your properties file if you are using spring-boot.
This will ignore previous migrations.
outOfOrder did not fix the problem for us.
Two migrations slipped into one deployment before it got removed.
So we added those migrations back in and undid the changes in another migration.
Worked 🤷
In my case, I just renamed my migration file to some other name and then renamed it back – just to update modification date of the file. And it worked.
In my case, there was existing a row with version 319 in database and the correponding file for 319 was renamed do 330, so the database registry could not find the corresponding file. Deleting the row from database solved the problem.
Since spring.flyway.ignore-missing-migrations=true became deprecated.
According to the docs I advise using spring.flyway.ignore-migration-patterns=*:missing. Or in the yaml:
spring:
flyway:
ignore-migration-patterns:
- "*:missing"

Does Dapper work in medium trust?

Just getting started with Dapper. I'd like to use it, but I have to be sure that it will work in a medium-trust server situation. I've googled for answer without any luck.
Thanks.
SecurityException - Dapper on shared hosting
As per the link above, it doesn't look like this is possible.
Dapper actually does work but in a limited way. I've gotten the Get methods to work fine but the updating and inserting seems to be the major problem area so I just manually do those. Oh well. I like Dapper too much to drop it completely.

cakephp callback before every database operation

Recently my records started to disappear from my application's database so I want to log every database operation cakephp makes. Where should I put the logging commands?
P.S.: This is not the first time cakephp do this to me. Did anybody face this problem?
You have a function beforeSave() in model.
public function beforeSave(){
// code for logging
}
You can put it in AppModel.php. It's called before saving to DB.
Edit:
Well, I have found something and I hope it will help you:
http://bakery.cakephp.org/articles/rainchen/2009/03/09/how-to-debug-as-in-rails
You'll have to make your own DatabaseLoggerClass. Or
this article will help you achieve the same what you needed.
This documentation page might also help you to save log for each database operation.

CustomServiceHostFactory and Generating proxies in silverlight

Hi I'm using and Custom ServiceHostFactory, and when I want to update service reference it would'nt work because I assume it needs to setup my servicehostfactory and it will crash.
I have looked for other approaches to not use the generation, but I havent found any good replacements.
Are there anyway to go around this, to not remove the servicehostfactory from the svc files everytime and then put them back there after service reference updates :S.
We use the non generation method described in this dnrtv screencast.
It has worked very well for us. Prevoiously we wasted alot of time due to references not updating or developers forgetting to update a reference before they checked in code.
I rechecked the namespace path and it were wrong in the svc file.

Resources