stanislav bashkirtsev

Ranch Hand
+ Follow
since Aug 17, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by stanislav bashkirtsev

Maybe the only way is to create bidirectional relationships...
There are two of "select"((( It's very bad for performance(
1. I have Customer. It has many Accounts.
2. I have Payment, that has one Account.
Question: how can I fetch all payments where customer=?
The SQL is something like this:
What it will be look like in HQL?
The problem was not about nested transactions. Some operation with database were simply performed in other connection.
My TransactionManager has field "nextedTransactionAllowed". But when I set it "true", nothing changes.
I'm working with MySQL and I have 2 transaction, one is within the other.
External:
Inner transaction:
Class-helper, that works with Hibernate-transactions:
The inner transaction is committed. But when the external transaction is tried to be committed, we wait 100 seconds(this is configured in configuration of MySQL), then the exception is thrown. Here is the log that contains the error:

[19:44:40] jt.monty: Hibernate: select this_.id as id29_1_, this_.username as username29_1_, this_.password as password29_1_, this_.framedIP as framedIP29_1_, this_.framedMask as framedMask29_1_, this_.blocked as blocked29_1_, this_.checkHost as checkHost29_1_, this_.ipPool as ipPool29_1_, this_.lastConnection as lastConn9_29_1_, this_.service as service29_1_, service2_.id as id24_0_, service2_.status as status24_0_, service2_.begin as begin24_0_, service2_.end as end24_0_, service2_.serviceInfoId as serviceI5_24_0_, service2_.tariffPlanId as tariffPl6_24_0_, service2_.accountId as accountId24_0_ from RadiusAccount this_ inner join services service2_ on this_.service=service2_.id where this_.id=? and 1=1
Hibernate: select this_.id as id24_2_, this_.status as status24_2_, this_.begin as begin24_2_, this_.end as end24_2_, this_.serviceInfoId as serviceI5_24_2_, this_.tariffPlanId as tariffPl6_24_2_, this_.accountId as accountId24_2_, tariffplan2_.id as id4_0_, tariffplan2_.title as title4_0_, tariffplan2_.userCharge as userCharge4_0_, tariffplan2_.type as type4_0_, tariffplan2_.beginDate as beginDate4_0_, tariffplan2_.endDate as endDate4_0_, account3_.id as id12_1_, account3_.number as number12_1_, account3_.balance as balance12_1_, account3_.type as type12_1_, account3_.status as status12_1_ from services this_ left outer join tariffPlans tariffplan2_ on this_.tariffPlanId=tariffplan2_.id inner join accounts account3_ on this_.accountId=account3_.id where this_.id=? and 1=1
Hibernate: select tariffs0_.tariffPlanId as tariffPl4_1_, tariffs0_.id as id1_, tariffs0_.orderIndex as orderIndex1_, tariffs0_.id as id0_0_, tariffs0_.price as price0_0_, tariffs0_.title as title0_0_ from tariffs tariffs0_ where tariffs0_.tariffPlanId=?
Hibernate: select properties0_.tariffId as tariffId0_, properties0_.value as value0_, properties0_.property as property0_ from tariffProperties properties0_ where properties0_.tariffId=?
Hibernate: select this_.id as id85_0_, this_.status as status85_0_, this_.begin as begin85_0_, this_.end as end85_0_, this_.serviceInfoId as serviceI5_85_0_, this_.tariffPlanId as tariffPl6_85_0_, this_.accountId as accountId85_0_ from services this_ where this_.accountId=? and 1=1
Hibernate: insert into financialOperations (balance, description, operationSum, accountId, date) values (?, ?, ?, ?, ?)
Hibernate: insert into serviceExpences (price, saveDate, account, tariffPlan, service) values (?, ?, ?, ?, ?)
Hibernate: update accounts set number=?, balance=?, type=?, status=? where id=?
2009-10-06 20:42:35,031 WARN net.jradius.freeradius.FreeRadiusProcessor(5) [org.hibernate.util.JDBCExceptionReporter] - SQL Error: 1205, SQLState: 41000
2009-10-06 20:42:35,031 ERROR net.jradius.freeradius.FreeRadiusProcessor(5) [org.hibernate.util.JDBCExceptionReporter] - Lock wait timeout exceeded; try restarting transaction
2009-10-06 20:42:35,031 ERROR net.jradius.freeradius.FreeRadiusProcessor(5) [org.hibernate.event.def.AbstractFlushingEventListener] - Could not synchronize database state with session
org.hibernate.exception.GenericJDBCException: could not update: [model.entity.customer.account.Account#1]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2430)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2312)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2612)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:96)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135)
at org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:72)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:905)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:715)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
at model.dao.TransactionManager.commit(TransactionManager.java:33)
at tariffication.TarifficationManagerImpl.saveData(TarifficationManagerImpl.java:67)
at tariffication.TarifficationManagerImpl.tariffy(TarifficationManagerImpl.java:32)
at radius.accounting.SessionUpdater.tariffySession(SessionUpdater.java:24)
at radius.accounting.processor.SessionUpdateProcessor.proccessSession(SessionUpdateProcessor.java:26)
at radius.controller.impl.AccountingController.handleRequest(AccountingController.java:26)
at radius.RadiusRequestHandler.handle(RadiusRequestHandler.java:18)
at radius.dispatcher.RadiusRequestDispatcher.handle(RadiusRequestDispatcher.java:24)
at net.jradius.handler.PacketHandlerBase.handle(PacketHandlerBase.java:49)
at net.jradius.handler.EventHandlerBase.execute(EventHandlerBase.java:66)
at net.jradius.server.RadiusProcessor.runPacketHandlers(RadiusProcessor.java:130)
at net.jradius.freeradius.FreeRadiusProcessor.processRequest(FreeRadiusProcessor.java:57)
at net.jradius.server.Processor.process(Processor.java:123)
at net.jradius.server.Processor.run(Processor.java:99)
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2019)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1937)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1922)
at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:23)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2408)
... 28 more

Maybe someone can help me? I don't even know the source of the problem...
Here what I needed:

Thanks for your attention!
In JDK there is old bad version of JAXB, so we should use separate libs. I saw this repositories, but I don't want to search for every lib in it( So I want somebody to show their dependencies from their projects..
Can you give me, please, all needed maven-dependencies for jaxb, jax-ws? I don't actually use JAXB, I should code another part of application, but I need to write dependencies in maven for jaxb, jax-ws to build and run entire application.
EE Application is an application of enterprise scale.
As far as I know JDBC, for example, is EE technology.
8 years ago
There is no any really good books on Flex. I read OReilly Learning Flex 3 Jun 2008 for knowing core. And then I will continue with this book. But one experienced developer said me that the main knowledge I would gain only from my own experience.
8 years ago
How DI can help to reduce amount of factories?
Use System.out.printf or NumberFormat.
8 years ago

makes appropriate calls to various subsystems

It's an Observer. Observer consists of Subject that has a list of Observers. When some event is triggered, this Subject iterates the whole list and invoke some method in each of Observers.
HashMap sorts by the hash of the keys. Use TreeMap to sort by key values.
8 years ago