Netbeans trys to connect to deleted jdbc - oracle

Here is how setup looks like:
ApplicationServer - GlassFish
Database Server - Oracle 10g2
Persistance Library - EclipseLink
Faces Framework - IceFaces
My Problem is that everytime I change the database connection the application/eclipselink stops working, failing to find the Persistance Unit.
After loosing a whole day trying to figure it out. I decided to delete all the information about connections and persistance units and use only one new created.
Building the project was not a problem, but running it I get an error, pointing that the there is a validationexception and a persistance unit with a given name was not found. That name is deleted and is't descriped in the persistance.xml nor in the sun-resources.xml. There is no such entry in the Services in Netbeans.
Have you seen such an error, and how can I make sure, that netbeans doesn't store information on places I can't reach from the IDE? How is it so that my application is looking for something that isn't listed anywhere...

Okay next time I have to think more, instead of asking the question here. So my problem was the cache directory of Netbeans 6.9.1.
Deleted the cache directory and everything started working again.
I hope that this problem is fixed in the next releases. it can be real pain in ... :)

Related

Is it possible to rollback mysql from 8.0.24 to 8.0.23?

I upgraded my dev server with mysql 8.0.24 but it doesn't work for me. I keep getting a fatal crash every time a query uses GROUP_CONCAT(DISTINCT... and there are no rows because of the WHERE. Anyway, I'd like to rollback to 8.0.23. Was the file format upgraded? Can I safely go back to 8.0.23?
Thank you.
After some reading, it's not easy to downgrade mysql. Mysql itself says it's not possible: https://dev.mysql.com/doc/refman/8.0/en/downgrading.html
I found some possible solution: https://subscription.packtpub.com/book/big_data_and_business_intelligence/9781788395809/1/ch01lvl1sec18/downgrading-from-mysql-8-0
But in the end, I decided to revert the whole dev server to the last backup; that was easier, just a few clicks and back on my feet.

Where to set Hibernate FlushMode?

I have an IntelliJ project using Spring MVC and with Hibernate FlushMode set to auto as default.
The problem is: when I try to delete an object from the db, using the web interface, it works fine, but after the third time I do that, the interface becomes not responsive (even though Hibernate receives the command to delete that certain object with that certain ID) and I have to reboot my WildFly server.
Any idea where I can change that? Is there a way to set it in a configuration file or I have to invoke a method to set it? And even if the problem is the FlushMode itself.
Regards
UPDATE: After testing several things, I think I finally found the root of the problem. If I access the db for more than three times consecutively, the server becomes unresponsive. How can I overcome this?
UPDATE#2: I found that the problem was that in the Dao the connection was opened but never closed (there wasn't a line "session.close()" just to be clear). And that was the reason After three pooling from the db, was it either to add items, delete them or just get infos, the server became unresponsive. Now everything works perfectly!
I actually didn't get your question properly.
The third time you try to delete something from your frontend, the web page gets stuck? The third time you make a delete request is the request stuck with hibernate? Could be a little clear about what actually is happening/or what issue you are facing.
To answer your question - how to setFlushMode in hibernate:
In case you using EntityManager -> entityManager.setFlushMode(FlushModeType.) -> JPA supports AUTO and COMMIT
In case you using SessionFactory:
sessionFactory.setHibernateFlushMode(FlushMode.) -> From hibernate 5
OR
sessionFactory.setFlushMode(FlushMode.) -> Before Hibernate 5
(NOTE: Please check the docs for accurate version of hibernate from which setFlushMode is deprecated.
Hibernate supports 4 modes of flush -> AUTO/COMMIT/ALWAYS/MANUAL

CodeIgniter error - unable to connect to database using the provided settings

I have a CodeIgniter setup that has been running fine for the past 2 months and recently I keep getting:
CodeIgniter error- unable to connect to database using the provided settings
I've recently added a new domain that has a landing page for the database login (zPanel), but I don't see how that could have caused a problem--maybe the page keeps getting directory attacked or something, but I'm not sure.
Is there a way to check if this is the problem through logs? I'm at dead ends with this problem, as when I restart the server (DigitalOcean) it works fine again.
Really not sure. If anyone else has had a similar problem, I'd love to hear your solution.
Thanks.
I think your mysql is going down so Codeigniter can't connect to your database settings.
Please login to SSH and check processes by "TOP" comment. See what is using resources ram or cpu.
And check your mysql conf settings, be sure that everything written if its empty it will cause alot of problems.
Some example :
http://www.maxwhale.com/how-to-optimize-mysql-for-1gb-memory-vps/

How to connect to oracle from a java servlet?

I have a problem connecting to oracle from within a java servlet running in Jetty (as part of Eclipse). The identical code runs fine from a standalone java app.
My entire development environment is on a single mac. I am using Eclipse and have included the ojdbc6.jar in the main 'Referenced Libraries' and have also dragged and dropped this file in the war/web-inf/lib folder.
As soon as the line
OracleConnectionPoolDataSource ocpds = new
OracleConnectionPoolDataSource();
is called (within the servlet) I get the exception:
java.security.AccessControlException: access denied
(javax.management.MBeanServerPermission createMBeanServer)
Am I missing some security policy or so? If so, exactly what do I do need to do to rectify this? And where does this BeanServer come in?
Thanks in advance.
Every web container has its own way of defining data sources, and making them available through JNDI. You should do that instead.
The native oracle connection pool seems to be creating an MBeanServer, and this is not probably not allowed by the security manager used by Jetty. See http://wiki.eclipse.org/Jetty/Feature/Secure_Mode and http://wiki.eclipse.org/Jetty/Tutorial/Jetty-Policy.
Worked it out - not entirely clear why but created a new GWT app in Eclipse but this time NOT included the Google App Engine (which is ticked by default). This seems to add some restrictions to the code when it is running in Jetty....
I now have copied the sample code over and all is working well!

AspNet Membership: Warning: Fatal error 9001 occurred

I'm setting up a new website and the site uses asp.net membership. This was working fine but today when I try and log in or do anything such as add a new user/role in the asp.net configuration wizard I get:
Warning: Fatal error 9001 occurred at Jul 30 2012 7:52PM. Note the error and time, and contact your system administrator.
Searching online, it seems to suggest that the logs are full, but I'm advised by the website host that there is ample free space, so I dont really know what to try next.
Has anyone come accross this before and if so, how did you manage to resolve it?
Thanks
I have had this problem recently too and after mountains of research it appears to be common when a database is set to AUTO CLOSE. I set all the databases to AUTO CLOSE = FALSE. This started with one database then went over to two and the next it was on all of them. I simply restarted the SQL Server Instance Service instead of restoring databases. Another way to fix the symptom is to take the problematic database offline and bring it back online again.
As it turns out this was a database issue. I couldn't even create a new table or drop a table and ultimately had to get the database restored, which solved everything.

Resources