log4net store ADO.NET call - log4net

I'm new in using log4net . Now I need to create a window form app , and it can log all ADO.net call from my website . it means save all what parameter and call I'm passing to DB !
Thanks all !

Related

Best practice to use django db connection in network call

I have two Django projects with DRF and have some Rest API's
I want to use db connection of one Django project to another so i need to pass db connection/credentials over api network. I know we can get connection object using following
from django.db import connections
db_conn = connections['default']
and what am thinking is
1- to pass above db_conn in an api call as parameter to second project api but when am getting on other side its showing as string not as db connection object.
2- Another option is to pass credentials and create connection using sql alchemy in second project.
So what is the best approach in above two scenarios?. Also it would be great if you can answer how to pass db connection object in api params as object not string
I dont think you can put the object as parameter in the api request. A string is the best result you will get. Besides i would not be very happy with that info in the api!
Option 2 is the better aproach i would think.

Copy Database on Azure without performance jump

I use the Azure .NET Fluent SDK to copy a database:
var backupDb = await azure.SqlServers.Databases
.Define(targetDbName)
.WithExistingSqlServer(server)
.WithSourceDatabase(sourceDb)
.WithMode("Copy")
.CreateAsync();
Under the hood it makes the following API call with the mode Copy . It works well, however it gives me a short ~14% spike on the performance graph
which doesn't happen at all when I run the copy procedure within the Azure portal or with the New-AzureRmSqlDatabaseCopy cmdlet.
Is there any reason why the Fluent SDK/REST API call causes this spike? Is there any way to get rid of that?

OpenNTF Domino API: "org.openntf.domino.utils.Factory is not initialized for this thread"

I'm trying to implement OpenNTF Domino API as a replacement in our project but it fails with this message:
"OpenNTF Domino API: org.openntf.domino.utils.Factory is not initialized for this thread!"
Code snippet:
boolean init = Factory.isInitialized(); // false
Database db = Factory.getSession().getCurrentDatabase(); // This fails of course because no Session
I'm implementing the call in a JAVA DAO behind a EXTLib Servlet in XPages.
So it's not called by an XPage but as an REST API call.
The Domino API Demo DB is working so the server install seems to be OK.
Is there a setup, properties I'm missing to init it ?
Yes, there is specific setup require for non-XPages access, as done in OsgiWorlds on OpenNTF. Nathan has added a DAS extension specifically for REST access from Graph database. You basically need to initialise the session for the Factory before trying to access it, generally done in the Servlet when it initiates the HTTP connection. Please contact me on Twitter (Paulswithers) so the team can work with you. Also it's worth you having a look at the OsgiWorlds source code. Although that's for a Vaadin servlet and allows defining a development user to run as, in production mode it also uses the logged on user name and the configuration class and calls to it from the servlet are effectively what you need from the REST servlet.

Azure Mobile Service (node backend) __updatedAt property not automatically set after edit

After reading the documentation I was expecting that this field is automatically set by Azure Mobile Services. Apparently it isn't.
Should I configure something extra?
Other options that I see (to do for each table):
* add an axtra line to the node js update(item, user, request) function:
item.__updatedAt = new Date();
* create an update trigger in the database
Anybody experience with this?
Thx!
The __updatedAt column is updated by a trigger created in the underlying SQL Server database, so it should be updated any time a row is updated. Note that this requires a database operation to occur for it to be updated.

azure storage account

I'm trying to deploy an application on Azure but I'm facing some problems.
on my dev box, all works fine but I have a problem when I'm trying to use the application once it is deployed.
on the dev box, I have an action that I do manually wich crates the test tables in my local sql server express.
but I do not know how to create the tables on the server ? so when I run my website application, it says TableNotFound.
Can sy guide me through this final step ? do I need to make sg additional ?
Thx in advance
The table storage client provides a method to create the schema in the cloud storage; I forget the name (will look it up in a second); call that when you initialise whatever you're using as your data service layer.
Edit: The following snippet is what I use:
StorageAccountInfo = StorageAccountInfo.GetDefaultTableStorageAccountFromConfiguration();
TableStorage.CreateTablesFromModel( typeof( <Context> ), info );
where <Context> is your data context object.

Resources