Closed GoogleCodeExporter closed 9 years ago
Correction:
'* Optionally specify MBean name with ';JMX=mbeanName'; default is the
database's short name'
should instead be
'* Optionally specify MBean name with ';JMX_MBEAN_NAME=mbeanName'; default is
the database's short name'
Original comment by eric.anl...@gmail.com
on 9 Nov 2010 at 11:38
The MBean attributes and operations I've added are based on the ones that
appear in INFORMATION_SCHEMA.SETTINGS.
Original comment by eric.anl...@gmail.com
on 10 Nov 2010 at 12:07
I changed your patch, please review it.
Do you really want your email address in the source code? You will get more
spam this way.
I know this is a bit silly, but could you state that you wrote it yourself? See
http://h2database.com/html/build.html#providing_patches ("I wrote the
code...")? It's just for legal reasons. Some companies did ask me about such
guarantees in the past.
I renamed the interface H2DatabaseMBean to DatabaseInfoMBean and the class
H2Database to DatabaseInfo.
I renamed the map mbeanObjectNames to MBEANS.
I moved all mbean support to the class DatabaseInfoMBean, so that it's easier
to remove the functionality (just delete the classes) if not required. The
Engine class uses reflection to register and unregister.
The constructor is no longer public.
I removed "final" in most declarations. I find them distracting.
The "{@inheritDoc}" is superfluous I believe. I removed those.
The following javadoc is also superfluous:
/** Database. */
private final Database database;
The following expression is weird: "command == null ? null : command". Why not
just "command"?
I couldn't open two connections (that was after I changed your code, maybe it
was my mistake).
I renamed the "print" methods (printSessions,...) to "list" methods
(listSessions,...)
The result of the "print" methods is hard to read because it's on one line. I
use multi-line results instead. I wonder if this works on Windows?
The parameter "boolean includingSystemSession" in the print methods is listed
as "p1" in the JConsole. That's not user friendly. I believe it's better not to
use parameters if there is no easy way to provide the name.
The operations no longer synchronized on the database. Otherwise this blocks:
create alias sleep as 'void x() throws Exception { Thread.sleep(1000); }';
create table test(id int primary key) as select 1;
select sleep() from system_range(1, 10), test;
I also want to make sure JMX support is not included in the small jar file
(build jarSmall).
Also I didn't run the build and didn't test it yet.
Could you create a unit test for this feature?
Original comment by thomas.t...@gmail.com
on 13 Nov 2010 at 5:21
Attachments:
I combined listSessions an listLocks (listSessions now includes information
about locks)
The bean name now includes the full path (because the short name may not be
unique, and as additional information to find out where the database is stored).
I added getVersion().
I added getTraceLevel() and setTraceLevel(int level).
I added setCacheMaxSize(), setLogMode().
JMX support is execluded from the small jar file (build jarSmall).
I renamed getFileCacheX to getCacheX.
I added MBean documentation by converting the Javadoc to a resource (as it's
done for tools).
The settings are now sorted by name.
I removed the JMX_MBEAN_NAME (I think it's not necessary any longer).
Todo:
We need user documentation.
If possible, there should be some automated test cases.
Original comment by thomas.t...@gmail.com
on 14 Nov 2010 at 12:10
I have committed the changes in the trunk in revision 3126.
Original comment by thomas.t...@gmail.com
on 15 Nov 2010 at 8:52
Enabled in version 1.2.147.
Original comment by thomas.t...@gmail.com
on 21 Nov 2010 at 5:53
Hi, thanks for getting this in!
I wrote the code, it's mine, and I'm contributing it to H2 for distribution
multiple-licensed under the H2 License, version 1.0, and under the Eclipse
Public License, version 1.0 (http://h2database.com/html/license.html).
Your changes look good to me. Could you also remove my email address from
DatabaseInfo and DatabaseInfoMBean? Attached is a small patch for this. Thanks!
Regarding adding test cases, one option is to extract the methods of Database
referenced in DatabaseInfo into an interface and mock that interface using a
tool like EasyMock. This would make adding test cases almost trivial.
Original comment by eric.anl...@gmail.com
on 13 Dec 2010 at 6:41
Attachments:
Thanks! I committed the changes. The code coverage is now good at 91%, see also
http://h2database.com/coverage/overview.html - details at
http://h2database.com/html/build.html#automated
Original comment by thomas.t...@gmail.com
on 13 Dec 2010 at 7:19
Original issue reported on code.google.com by
eric.anl...@gmail.com
on 9 Nov 2010 at 11:36Attachments: