Thursday, August 26, 2010

Could not inspect JDBC autocommit mode

Could not inspect JDBC autocommit mode

JPA and EJB3 Caveats - I

javax.persistence.PersistenceException: [PersistenceUnit: UnitName] class or package not found

WARN [ServiceController] Problem starting service persistence.units:ear=

If you get the above warning followed by the exception in the title, check your persistence.xml, some of the entity classes maybe declared wrong (e.g. point to wrong package).


JPA/EJB 3 Setup on Eclipse

Make sure that the persistence.xml file is located in the META-INF of the EAR Project.
Having it in your JPA project does NOT automatically propogate this file to where it needs to be.

Tuesday, August 10, 2010

Quotes

Optimist/Pessimist
The optimist live in the peninsula of infinite possibilities, where as the pessimist is stranded on an island of perpetual indecision.

Saturday, May 29, 2010

Virtual Memory arguments for Eclipse

On Windows:


C:\eclipse\eclipse.exe -data c:\MyWorkspace -vmargs -Xms128M -Xmx256M


Workspace location = MyWorkspace
Starting memory = 128 mb
Maximum memory = 256 mb



Monday, February 15, 2010

C++ Listing all Directories in a Folder.

View the contents of a directory

This is how you get the contents of a directory in Windows with C++.

#include 
#include 

using namespace std;

int main()
{
WIN32_FIND_DATA FindFileData; 
HANDLE hFind = INVALID_HANDLE_VALUE; 
char DirSpec[MAX_PATH]; // directory specification 

cout<<"Path: ";
cin.get(DirSpec, MAX_PATH);
cout<<"\n";
strncat(DirSpec, "\\*", 3);
hFind = FindFirstFile(DirSpec, &FindFileData);

 if(hFind == INVALID_HANDLE_VALUE)
 {
 cout<<"Error: invalid path\n";
 }

cout<<<"\n";

 while(FindNextFile(hFind, &FindFileData) != 0)
 {
 cout<<<"\n";
 }

FindClose(hFind);

return 0;
}