We're developing a software with Weblogic application server (12.1.1.0); We have one domain with two applications.
We just moved up from development DB to pre-production DB (similar to production), and oh boy we got a major issue going...
DBA says the DBs are running the same version - Oracle 11 (I don't recall the exact version). The only difference we can see is that the dvlp DB uses SID for connection, and the other two uses service-name.
Now, in our domain we have two data sources X and Y. Both are connected to the same DB. We use XA driver on both. Both our applications uses the same 'persistence.xml' (and entities) which has two PUs (persistence units), each using a different data source (X and Y).
The problem is this:
An MDB starts handling a request.
It uses both PUs with EntityManagers and the Y data source with DataSource interface, which is used to get a connection (we have some JDBC code).
It calls a bean from the other application.
The other bean tries to use one of the PUs (the one connected to X data source).
SQLException is thrown:
XA error: XAResource.XAER_NOTA start() failed on resource 'x_my_domain': XAER_NOTA : The XID is not valid
We've searched the error online and we found out that we should change the data sources' configuration to
XASetTransactionTimeout=true
XATransactionTimeout=0
but that didn't worked.
We've also tried (a lot) to tweak the data sources' configuration, eventually removing one of them so we only need to tweak with only one of them, but nothing has worked.
In addition, while repeatedly tweaking the configuration, a different SQLException has slipped under our radar and started popping out instead of the previous:
Internal error: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceDisabledException: Pool X is Suspended, cannot allocate resources to applications
Now this one is even more frustrating, because we tried everything; reset the data source; delete and re-create; delete and re-create with different name; delete the domain and re-create with a different data source name; go back using the dvlp DB; but nothing, the exception seems to persist.
We really don't have any idea of how to solve this and we can't go any further without fixing this problem.
We finally found how to fix the problem, but to answer the question I will have to explain more about our environment; We actually have two managed servers, and each application runs on another server. Both the admin-server and one of the MS runs on one machine, and the other MS runs on another machine (total of two machines).
The thing was that when we modified one of the data sources (X), which was used also by the other MS, we didn't restarted the other MS, but only the data-source. We guess that this caused the data-source not to update with the new modifications on the other MS, which caused the errors we encountered.
The problem was caused by a rather foolish reason, but it was hard to spot because it recurred on any environment setup of the admin-server + first MS part, even on our own PCs with a setup of only an admin-server with no definition of machines. The reason it still happened is because the address of the machine containing the other application was written in the code (read from XML configuration, but that doesn't change much).
Well, glad that's over with.
Related
Playing on a linux hosted AzerothCore rev. be423a91b535 master branch.
Whenever as a paladin I hit a target with my abilities and then someone else swings at it the entire server crashes. The only error that shows up in log is this.
We've tested this with multiple characters on multiple accounts and and in all instances after casting either of my judgement of light, or judgement of mana causes the server to crash completely when another character swings at said target.
It does not happen if I do not use these abilities and just attach the target at the same time with another player.
This is a clean server recently set up, no additional modules or changes beyond lowering guild signing size.
error image
I've also gotten a snapshot of the server config if that has useful information.
Server config
Apparently there was a module added QAston Proc, and this causes world crashes. If anyone else has this issue updating should clear it up as the commit was removed.
I have spent 2 days chasing this one round and round, and I have tried several solutions (detailed below).
Problem. When retrieving Geographical data from a Microsft SQL Database I get an error
DBServer routine OpenDataSet has failed with error DataReader.GetFieldType(3) returned null.
From what I have read, this is typically because the project cannot load or access Microsoft.SqlServer.Types, so it can't interpret the returned data effectively
What I have tried;
Removing and readding the reference.
Setting the assembly to copy Local
Removing and reinstalling via Nuget (v14.0)
Referencing said assembly in the web.config
Adding a utility class in Global.asax, then calling that on Application_Start to load in the other dependent files
LoadNativeAssembly(nativeBinaryPath, "msvcr120.dll")
LoadNativeAssembly(nativeBinaryPath, "SqlServerSpatial140.dll")
The error happens whether I am running locally (not such a key issue) or on an Azure vps (SqlServer Web Edition).
The stored procedure I am calling to return the data works fine. (In fact, this code is a lift and shift project. the old vps works fine if we fire it up, so it is most likely a configuration issue and all the above I have done is wasted effort. But the original developer is not contactable, nor are there any notes on how this was made to work.)
I am developing a winforms application in Vb.net
when i try to add a tableadapter to an existing dataset I am receiving the error:
Failed to open a connection to the database.
"An attempt to attach an auto-named database for file ###Filelocation### failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share." Check the connection and try again.
This same dataset has 2 other tableadapters using the same dataconnection (as I am selecting the already existing dataconnection) which work fine
this connection is using application connection strings:
Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\test.mdf;Integrated
server=localhost;user id=root;password=password;database=testuser;persistsecurityinfo=True
this error pops up every time I select the dataconnector on the first window that pops up.
Why is this happening
additional info:
The other 2 tableadapters were added to this dataset using a different computer
this is for a mysql connection
I found this post on the MSDN forum:
An attempt to attach an auto-named database ....\aspnetdb.mdf failed
One of the suggestions is as Mr. DonBoitnott correctly says, add User Instance=True;. But, there's also another suggestion posted by Luke A.
"For the record, not one single error message given to me during the course of trying to fix this was relevant to the actual problem. Upon first receiving "An attempt to attached an auto-named database..." I looked online for every suggestion I could find: use an absolute path to the MDF, reorder TCP/IP and named pipes in the server configuration, disable/enable UserInstance (depending on where you looked), change security settings, reconfigure authentication, give specific login credentials.
None of these worked. All of these led to different vague/ambiguous error messages, which led to another problem which required a solution which led back to the original error message... an endless loop of problems, completely unrelated to what was actually wrong.
_Also, posts about setting correct permissions on the App_Data folder are deceptive, as they imply the default permissions were not sufficient for SQL Express (in fact, they are). The whole point of this VS environment is that you can develop a web application and plop it right onto an IIS/SQLExpress setup and have it work. This makes the applications more portable (within IIS, of course) and secure. Of course, everything configuration-related has been obfuscated enough to make it several orders of magnitude more difficult than it has to be."_
So: Try prepend Initial Catalog=uniquenamehere to your connection string.
Though he says "... where 'uniquenamehere' is some name for your project.", try replacing uniquenamehere with the actual name of the database where the table exists.
the file is a .mdf file so it is a mssql file
my guess would be that as you stated you are using mysql the connection string has to be a tad different and therefore the Dataset can't connect to Mysql
Try adding User Instance=True; to the connection string.
After a whole day tracking down a memory leak in my VB.NET project, I have traced the cause to a bug with FileMaker's ODBC driver !
To reproduce you'll need a database you can connect to (I have mine hosted on Server Advanced 11.0.3, but you can also host it locally), and the ODBC driver registered/installed on the PC (I tested versions 11.3 and 12.0, and the latest 12.2).
Start a new VB.NET WinForms project, add a button to the form and paste this code onto the button's click event:
Using cn_FM As New Odbc.OdbcConnection("DRIVER={FileMaker ODBC};SERVER=192.168.1.xxx;UID=admin;PWD=admin;DATABASE=test;")
cn_FM.Open()
End Using
All this code does is open a connection to a FileMaker database, however if you analyse the memory usage in Windows Task Manager you can easily see (by repeatedly clicking the button you just made) that cn_FM is not being disposed properly because the Handles keep increasing! I tried forcing Garbage Collection but this didn't do anything, so I assume its a problem with the driver itself.
Oh, and I tested connecting to a SQL database in the same way, and as you would expect, there was no handle leakage...
Can anyone confirm this is correct?
Edit: I tried various ways of opening and closing the connection, as well as actually querying the database for something in the using block. Also tried hosting the fp7 file locally, but still no go :(
FileMaker's ODBC drivers are horrible and they admit it. You'll also find that your CPU spikes to nearly 100% for every query you hit the FM server with. I've been griping at them about it for years.
Their "solution" was to introduce External SQL Sources, but that requires you to go the other direction. You can bind your VB database to FileMaker and then access the data just like actual FileMaker data. This will allow you to create scripts on the FM server to sync whatever tables you need to sync with your VB database.
It's not ideal, but that's going to be your best bet to get something together with good performance.
I got around this problem by making a persistent connection (declare and open it once and leave it open). But I need to check if its still open each time I want to use it, for example:
Public Sub CheckOpen(ByRef cn As Odbc.OdbcConnection)
If cn.State <> System.Data.ConnectionState.Open Then
cn.Close()
cn.Open()
End If
End Sub
If you have multiple FM database files then this may mean you need to have one connection for each file.
Side Note: FileMaker's xdbc_listener.exe process running on FMSA is also leaky. We have noticed a pattern that once it reaches just under 2GB memory usage it crashes. So keep in mind that the process may need constant restarting.
UPDATE
As Mathias notes below, this exact problem has been reported and resolved here:
ASP.NET-MVC (IIS6) Error on high traffic: Specified cast is not valid
ORIGINAL POST
This may be too specific a debugging issue to be posted here, but I'm posting it anyway in the hopes that it produces a solution that others find useful.
I have a web application that operates under moderate load -- maybe 5 requests per second. It has some older code talking to Sql via ADO.NET + DataReaders and has been using this same technique for at least five years without problem. It also has some newer code using LINQ-to-SQL. Both techniques use the same connection string to maximize connection pool reuse.
Recently I'm experiencing a very weird behavior described by these symptoms:
Everything will work perfectly for about a day, then suddenly every call (or nearly every call) to the data layer (both ADO.NET and LINQ) returns data that cannot be parsed by my code -- I'll get exceptions like "Unable to cast object of type 'System.Int32' to type 'System.String'." or "Sequence contains no elements" or "IndexOutOfRangeException" or "Invalid attempt to call Read when reader is closed".
Interestingly, I never get exceptions from SqlCommand.ExecuteReader() or DataReader.Read() -- the exceptions only occur when I try to parse the IDataRecord that is returned.
I am able to fix the problem temporarily by restarting either Sql or IIS. After a few hours it comes back again.
I've tried monitoring the number of connections in the connection pool and it never goes above 3 or so. Certainly never above 100.
I'm not getting anything in the event log that indicates any problem with Sql or IIS.
The drive has 9 GB empty space.
I suspected bad RAM, but the server is using registered ECC DIMMs.
I have other applications using ADO.NET that work fine and never exhibit the problem.
When the problem is occurring I can call the exact same stored procedures via Management Studio and they return the correct, expected results.
Here is my pattern for ADO.NET access:
using (var dbConn = Database.Connection) // gets already-open connection
{
var cmd = new SqlCommand("GetData", dbConn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("#id", id);
SomeDataObject dataObject = null;
var dr = cmd.ExecuteReader(CommandBehavior.CloseConnection | CommandBehavior.SingleRow);
if (dr.Read())
dataObject = new SomeDataObject(dr);
dr.Close();
return dataObject;
}
Theory: Is it possible that the combination of ADO.NET in one part of the code and LINQ in another part of the code, both using the same connections from the connection pool, is having some weird side-effect?
Question: Are there any debugging steps I should be trying? Any events logs or performance metrics that might help?
20+ open connections on 5 hits/second is a red flag to me. We have close to 100 hits/sec and hover around 10 connections.
What about memory use? Is it high?
I suspect you're having problems with releasing resources. I'm still getting my feet wet with LINQ to SQL and I too have a long positive expereince with ADO.NET. I wonder if you're missing a pattern with LINQ to SQL that cleans up connections, etc.
Try this - can you isolate the ADO.NET code from LINQ in the application? If you ONLY make ADO.NET calls, what happens to memory, connection count, etc? Then add in the LINQ stuff and see how it affects it.
Resource problems seem to 'start up late' becuase they take a while to accumulate.
UPDATE
I found someone on SO who apparently has the same issue
ASP.NET-MVC (IIS6) Error on high traffic: Specified cast is not valid.
It is expained in the answer from ATLE
ORIGINAL POST
I have seen issues in a linq-to-sql application when under load. I used MVC - Storefront from
Rob Connery so I guess a lot of people use this kind of application layout.
The application worked perfectly when under little load, but there where strange errors that sounded like the one you describe when under medium load.
I suspected that it was an issue with where the db-context was stored.
In my case it was easy to reproduce: I used jmeter and had 5 threads each having a couple of requests per second (20 I guess). I realy needed to have load originating from multiple threads.
So my advice is: Try to reproduce the error in development by creating some load with Jmeter (not good for ASP.NET but for ASP.NET MVC) or application center test.